Edit this page

columnReorder

Fired when the user changes the order of a column.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.column Object

A JavaScript object which represents the column configuration.

e.newIndex Number

The new column index.

e.oldIndex Number

The previous column index.

e.sender kendo.ui.TreeList

The widget instance which fired the event.

Example - subscribe to the "columnReorder" event during initialization

<div id="treeList"></div>
<script>
    $("#treeList").kendoTreeList({
        columns: [
            { field: "name" },
            { field: "age" }
        ],
        dataSource: {
            data: [
                { id: 1, parentId: null, name: "Jane Doe", age: 22 },
                { id: 2, parentId: 1, name: "John Doe", age: 24 }
            ]
        },
        reorderable: true,
        columnReorder: function(e) {
            console.log(e.column.field, e.newIndex, e.oldIndex);
        }
    });
</script>

Example - subscribe to the "columnReorder" event after initialization

<div id="treeList"></div>
<script>
    function treelist_columnReorder(e) {
      console.log(e.column.field, e.newIndex, e.oldIndex);
    }

    $("#treeList").kendoTreeList({
        columns: [
            { field: "name" },
            { field: "age" }
        ],
        dataSource: {
            data: [
                { id: 1, parentId: null, name: "Jane Doe", age: 22 },
                { id: 2, parentId: 1, name: "John Doe", age: 24 }
            ]
        },
        reorderable: true
    });

    var treelist = $("#treeList").data("kendoTreeList");
    treelist.bind("columnReorder", treelist_columnReorder);
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy