Edit this page

hideColumn

Hides the specified column.

Parameters

column Number |String

The index of the column, or the field to which the columns is bound.

Example - hide a column by index

<button id="btn">Hide 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 }
    ]
  });
  $("#btn").click(function(){
    var treeList = $("#treeList").data("kendoTreeList");
    treeList.hideColumn(2);
  });
</script>

Example - hide a column by field

<button id="btn">Hide 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 }
    ]
  });
  $("#btn").click(function(){
    var treeList = $("#treeList").data("kendoTreeList");
    treeList.hideColumn("age");
  });
</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