User Interaction
Set the allowColumnReordering property to true to allow a user to reorder columns. If a specific column should not be moved, set its allowReordering property to false.
- $(function() {
- $("#treeListContainer").dxTreeList({
- // ...
- allowColumnReordering: true,
- columns: [
- { dataField: "CompanyName", allowReordering: false },
- // ...
- ]
- });
- });
API
The columns array determines columns' order. You can reorder columns by moving their objects within the array or by changing the column's visibleIndex if you prefer to configure columns using the customizeColumns function.
- $(function() {
- $("#treeListContainer").dxTreeList({
- // ...
- customizeColumns: function(columns) {
- columns[2].visibleIndex = 1;
- }
- });
- });
The visibleIndex property can also be changed at runtime to reorder columns regardless of the way you configured them. For this, call the columnOption(id, optionName, optionValue) method. The following code swaps the second and first column:
- $("#treeListContainer").dxTreeList("columnOption", 1, "visibleIndex", 0);
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.