Edit this page

reorderColumn

Changes the position of the specified column.

Parameters

destIndex Number

The new position of the column. The destination index should be calculated with regard to all columns, including the hidden ones.

column Object

The column whose position should be changed.

Example - move a column

<button id="btn">Switch Name and Age Column</button>
<div id="treeList"></div>
<script>
  $("#treeList").kendoTreeList({
    columns: [
      { field: "id" },
      { field: "name" },
      { field: "age" }
    ],
    dataSource: [
      { id: 1, parentId: null, name: "Jane Doe", age: 22, expanded: true },
      { id: 2, parentId: 1, name: "John Doe", age: 24 },
      { id: 3, parentId: 1, name: "Jenny Doe", age: 3 }
    ],
    selectable: true
  });
  $("#btn").click(function(){
    var treeList = $("#treeList").data("kendoTreeList");
    treeList.reorderColumn(2, treeList.columns[1]);
  });
</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