【发布时间】:2016-08-31 05:05:47
【问题描述】:
我有一个具有以下自定义命令的 Kendo TreeList:
{
command: [
{
name: "Edit",
imageClass: "fa fa-pencil"
},
{
name: "Delete",
imageClass: "fa fa-trash"
},
{
name: "createChild",
imageClass: "fa fa-plus"
}
], title: "Actions", width: "300px"
}
我点击创建子按钮,输入我的数据并点击“更新”。这将我带到我的 Kendo 数据源的“创建”定义:
create: function (e) {//Called when the create child command is saved
//Collect the data needed for the save
}
此时我需要获取新行的行索引,但我似乎找不到正确的方法。我试过这样的事情:
$(e.target).closest("tr").parent().index()
但这给出了-1
还有:
var selectedRow = $scope.treelist.select();
var node = $scope.treelist.dataItem(selectedRow);
但节点未定义
有什么想法吗?
【问题讨论】:
标签: kendo-ui kendo-grid kendo-treelist