我想在Kendo TreeList
的每个单元格中设置一个范围,默认情况下我会在Kendo Grid
中获取此范围,但我无法在Kendo TreeList
Kendo Grid:
<td role="gridcell" title="Control Box">
<span ng-bind="dataItem.partdesc" class="ng-binding">Control Box</span>
</td>
Kendo TreeList:
<td role="gridcell" title="Control Box"></td>
答案 0 :(得分:0)
我建议你两个解决方法,首先你可以使用列模板(但是你必须修改所有列,如果你希望每个单元格都像你描述的那样具有跨度),例如
$("#treelist").kendoTreeList({
columns: [ {
field: "name",
template: "<span class='Test'>#:name#</span> "
}],
dataSource: [ { name: "Jane Doe" }, { name: "John Doe" } ]
});
或者您可以在数据绑定上插入范围,例如
$("#treeList").kendoTreeList({
columns: [
{ field: "Name" },
{ field: "Position" }
],
dataSource: [
{ id: 1, Name: "Daryl Sweeney", Position: "CEO", parentId: null },
{ id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", parentId: 1 }
],
dataBound: function(e) {
e.sender.table.find("td[role='gridcell']").append("<span class='test'>Test</span>");
}
});