[英]kendo ui treelist - set cell template
I would like to set a span in every cell of Kendo TreeList
, I am getting this by default in Kendo Grid
but I am not able to set this in Kendo TreeList
我想在
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>
I would suggest you two workaround, first you can use column template (but you have to modify all column if you want every cell to have span like the one you described) like eg 我建议您采用两种解决方法,首先可以使用列模板 (但是,如果您希望每个单元格都具有您所描述的跨度,则必须修改所有列),例如
$("#treelist").kendoTreeList({
columns: [ {
field: "name",
template: "<span class='Test'>#:name#</span> "
}],
dataSource: [ { name: "Jane Doe" }, { name: "John Doe" } ]
});
Or you can insert the span on databound like eg 或者您可以在数据绑定上插入跨度,例如
$("#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>");
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.