0
votes

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.

1
i think want it does is sets the age as next column after id if you set as lockColumn. may be it is used to change the display order. - Suchit kumar
It actually has an effect, but that is only visible, if your treelist is scrollable and needs to be scrolled horizontally. Then you will see, that the column you set as locked, will not be scrolled - Markai

1 Answers

1
votes

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: enter image description here

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

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