简体   繁体   中英

lock a column kendo treelist

I am trying to lock a column in kendo ui treelist from here : 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>

This is not changing any thing on the treelist.

It's working fine, just reduce your browser width and you'll see the only the column name is scrollable, id and age are freezed.

Screen: 在此处输入图片说明

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

Demo: http://dojo.telerik.com/UZAhE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM