Vue TreeList - columns.columns

Configures columns.

Selector: DxColumn
Default Value: undefined

Unlike normal columns, band columns do not hold data. Instead, they collect two or more columns under one column header. To set up this layout, declare the band column using a hierarchical structure. For this, assign the nested columns to the columns field of the band column. For example, the following code declares the "Address" band column and nests three columns within it.

App.vue
  • <template>
  • <DxTreeList ... >
  • <DxColumn caption="Address">
  • <DxColumn data-field="City" />
  • <DxColumn data-field="Street" />
  • <DxColumn data-field="Apartment" />
  • </DxColumn>
  • </DxTreeList>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxTreeList, {
  • DxColumn
  • } from 'devextreme-vue/tree-list';
  •  
  • export default {
  • components: {
  • DxTreeList,
  • DxColumn
  • },
  • // ...
  • }
  • </script>

A nested column has almost every property a regular column has. These properties are described in the columns section of the Reference.

NOTE
There is an exception though: nested columns cannot be fixed alone, therefore specifying the fixed and fixedPosition properties for them is useless. However, the whole band column can be fixed as usual.

For example, the following code specifies the width and sortOrder properties of the "Street" column nested within the fixed "Address" band column.

App.vue
  • <template>
  • <DxTreeList ... >
  • <DxColumn
  • caption="Address"
  • :fixed="true"
  • fixed-position="right">
  • <DxColumn data-field="City" />
  • <DxColumn data-field="Street" :width="100" sort-order="asc" />
  • <DxColumn data-field="Apartment" />
  • </DxColumn>
  • </DxTreeList>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxTreeList, {
  • DxColumn
  • } from 'devextreme-vue/tree-list';
  •  
  • export default {
  • components: {
  • DxTreeList,
  • DxColumn
  • },
  • // ...
  • }
  • </script>

Band columns support hierarchies of any nesting level. It means that the following structure is acceptable.

App.vue
  • <template>
  • <DxTreeList ... >
  • <DxColumn caption="A">
  • <DxColumn data-field="A1" />
  • <DxColumn data-field="A2" />
  • <DxColumn caption="A3">
  • <DxColumn data-field="A31" />
  • <DxColumn data-field="A32" />
  • <DxColumn caption="A33">
  • <DxColumn data-field="A331" />
  • <DxColumn data-field="A332" />
  • <DxColumn data-field="A333" />
  • </DxColumn>
  • </DxColumn>
  • </DxColumn>
  • <DxColumn caption="B">
  • ...
  • </DxColumn>
  • </DxTreeList>
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxTreeList, {
  • DxColumn
  • } from 'devextreme-vue/tree-list';
  •  
  • export default {
  • components: {
  • DxTreeList,
  • DxColumn
  • },
  • // ...
  • }
  • </script>

Band columns have the isBand flag. Banded columns have the ownerBand property set. Use these properties to distinguish band and banded columns from regular ones in code.

See Also