TreeList & asp.net mvc 5 samples

2 posts, 0 answers
  1. Joyce
    Joyce avatar
    1 posts
    Member since:
    Jul 2015

    Posted 08 Nov 2015 Link to this post

    I tried to use TreeList with mvc5. 

    kendoUI:

       .kendoTreeList({
            dataSource: {
                type: "aspnetmvc-ajax",
                transport: {
                    read: {
                        url: "/Common/CommonProductBomInfo",
                        type: "POST",
                        data: { ProductBom: GA.current.dialog.param },
                    },
                    //parameterMap: function (options, operation) {
                    //    if (operation !== "read" && options.models) {
                    //        return { models: kendo.stringify(options.models) };
                    //    }
                    //}
                },
                schema: {
                    //data: "Data",
                    //total: "Total",
                    //errors: "Errors",
                    model: {
                        id: "id",
                        parentId: "parentId",
                        fields: {
                            id: { type: "string", nullable: false },
                            parentId: { type: "string", nullable: true }
                        },
                        expanded: true
                    }
                }
            },
            filterable: true,
            sortable: true,
            height:490,
            toolbar: ['excel'],
            columns: [
                { field: "Part_Code", title: "PartCode", width: 200 },
                { field: "Part_Name", title: "PartName", width: 160 },
                { field: "Part_Size", title: "PartSize", width: 120 },
                { field: "Part_Model", title: 'PartModel', width: 120 },
                { field: "Part_Material", title: 'PartMaterial', width: 140 }
            ]
        });​

    MVC:

        DataSourceResult result = Business.CommonProductBom(Guid.Parse(ProductBom)).ToDataSourceResult(request);
         return Json(result);

     

    It is not working well.

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 11 Nov 2015 Link to this post

    Hello Joyce,

     

    `It is not working well.` - what does it mean? Please clarify.

     

    Providing isolated runnable example will also help us to resolve this.

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top