锁定列kendo treelist

时间:2015-04-21 06:07:20

标签: javascript jquery kendo-ui

我正在尝试锁定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>

这并没有改变树冠上的任何东西。

1 个答案:

答案 0 :(得分:1)

它工作正常,只需缩小浏览器宽度,您就会看到唯一的列名称是可滚动的,ID和年龄都会被冻结。

屏幕: enter image description here

文档:http://docs.telerik.com/kendo-ui/web/grid/walkthrough#frozen-columns-locked-columns

演示:http://dojo.telerik.com/UZAhE

相关问题