Add/Update/Delete in Kendo Treelist

4 posts, 0 answers
  1. Sandhya
    Sandhya avatar
    3 posts
    Member since:
    Jul 2015

    Posted 23 Mar Link to this post

    I am using Kenod Treelist to display the hierarchical data and its working fine.
    I have placed the edit option to update/delete each row.
    Now I am facing issue, how to add new row to each level:
    My Treelist is having the hierarchy like below:
    --Main Node

       -----Parent Node1

                 ------Child Node1

                 ------Child Node2

      -----Parent Node2
    I should be able to add Main node/Parent Node/Child Node.
    I have tried with toolbar: ["create"] which will give me the option to add the main node.
    Any other way I can achieve this with Kendo Tree List?
    Or any other control I can opt to achieve the Add/Edit/Delete functionality with hierarchical node.
    Any help is highly appreciable.
    Thanks

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 28 Mar Link to this post

    Hello Sandhya,

     

    There is built-in createChild command that will render a button to add child for given item. Seems that this is what you are looking for.

     

    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. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sandhya
    Sandhya avatar
    3 posts
    Member since:
    Jul 2015

    Posted 28 Mar in reply to Nikolay Rusev Link to this post

    Hi Nikolay,

    Thanks for your input.

    Now the issue I am facing is Update/Delete command is not firing. I have created a separate custom method to do binding.Here is my code :

    var JobList = new kendo.data.TreeListDataSource({
                            data: data,
                           
                            schema: {
                                model: {
                                    id: "ID",
                                    parentId: "ParentID",
                                    fields: {
                                        ParentID: { field: "ParentID", type: "number", nullable: true },
                                    },
                                  
                                    expanded: true
                                   
                                }
                            },
                            transport: {
                                read: {
                                    url: //url here
                                    dataType: "json"
                                   
                                },
                                update: {
                                    url: url
                                   data: data
                                        function (data) { },
                                        "POST",
                                        false,
                                        null
                                        ),
                                 
                                },
                                 parameterMap: function (data, type) {
                                if (type == "update") {
                                    // send the created data items as the "models" service parameter encoded in JSON
                                    //return { models: kendo.stringify(data.models) };
                                    alert('Update');
                                }
                            }

    Could you please help me what I am doing wrong here?

  5. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2285 posts

    Posted 31 Mar Link to this post

    Hello Sandhya,

     

    We are not sure what might cause this behavior from the code snippet. We will need a isolated runnable example in order to assist you further.

     

    The following demo seems to be working properly - http://demos.telerik.com/kendo-ui/treelist/editing

     

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