Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kendo ui 如何在剑道树列表的一个字段中使用多个按钮?_Kendo Ui_Treelist - Fatal编程技术网

Kendo ui 如何在剑道树列表的一个字段中使用多个按钮?

Kendo ui 如何在剑道树列表的一个字段中使用多个按钮?,kendo-ui,treelist,Kendo Ui,Treelist,我想通过在树状列表中使用自定义命令在一个字段中使用2个或更多按钮,如剑道网格,但我不能这样做。有人有解决方案吗?您只需向列命令属性添加一组按钮: $("#treeList").kendoTreeList({ columns: [ { field: "name" }, { command: [ { name: "Cust1", text: "Custom1",

我想通过在树状列表中使用自定义命令在一个字段中使用2个或更多按钮,如剑道网格,但我不能这样做。有人有解决方案吗?

您只需向列命令属性添加一组按钮:

$("#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
});

谢谢@ezanker,但我能请你告诉我如何使用Kendo HtmlHelper做到这一点吗?