我试图从这里锁定kendo ui treelist
中的一列:http://docs.telerik.com/kendo-ui/api/javascript/ui/treelist
<div id="treeList"></div>
<script>
$("#treeList").kendoTreeList({
columns: [
{ field: "id", locked: true, width: 100},
{ field: "name", width: 200 },
{ field: "age", width: 150 }
],
dataSource: {
data: [
{ id: 1, parentId: null, name: "Jane Doe", age: 22 },
{ id: 2, parentId: 1, name: "John Doe", age: 24 }
]
}
});
var treelist = $("#treeList").data("kendoTreeList");
treelist.lockColumn("age");
</script>
这不会改变树列表上的任何内容。
最佳答案
它工作正常,只需减小浏览器宽度,您就会看到只有列名是可滚动的,id 和age 被卡住。
屏幕:
文档:http://docs.telerik.com/kendo-ui/web/grid/walkthrough#frozen-columns-locked-columns
关于javascript - 锁定一列剑道树列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29764182/