Working with Trees > Classes > TreeList > TreeList.ColumnVisibilityChanged
ColumnVisibilityChanged: function (sender, args);
sender. Event source.
args. Event information. Available arguments: Column - index of a column with modified visibility; Visibility - column visibility: true - column is displayed, false - column is hidden.
The ColumnVisibilityChanged event occurs after changing visibility of a tree column.
Layout of column headers is available if the TreeList.CaptionVisible property is set to true.
To display or hide tree column, click the button in the top right corner and in the drop-down menu select or deselect checkboxes for columns to display or hide.
To execute the example, create the TreeList component named treeListSett. Add the ColumnVisibilityChanged and ColumnVisibilityChangingevent handlers:
treeListSett.ColumnVisibilityChanging.add(function (sender, args) { console.log("Visibility changing of column with index " + args.Column) }); treeListSett.ColumnVisibilityChanged.add(function (sender, args) { if (args.Visibility == true) { console.log("Column with index " + args.Column + " is displayed") } else { console.log("Column with index " + args.Column + " is hidden") } });
After executing the example, on changing of column visibility in tree, the following message is displayed to the console "Visibility changing of the column with index <column index>".
After visibility changing of the column the following message is displayed to the console "Column with the index <Column index> is shown/hidden".
See also: