kendo-uitreelist

How to use more than one button in one field in Kendo Treelist?


I want to use 2 or more buttons in one field like Kendo Grid by using custom command in TreeList but I could not do that. Does anyone have a solution?


Solution

  • You just add an array of buttons to the column command property:

    $("#treeList").kendoTreeList({
      columns: [
        { field: "name" },
        {
            command: [
                {
                    name: "Cust1",
                    text: "Custom1",
                    click: function(e) {
                        alert("Custom1");
                    }
                },
                {
                    name: "Cust2",
                    text: "Custom2",
                    click: function(e) {
                        alert("Custom2");
                    }
                },           
            ]
        }
      ],
      editable: true,
      dataSource: dataSource
    });
    

    DEMO