SMART datagrid v.1 > Classes > ColumnGroup

Back  Forward

DataLudi.ColumnGroup.columns  property

The list of all child columns including the columns which are not displayed now. 

getter returns the columns as array. And, you can call setter to remove all existing columns and newly add the columns specified by parameter. visibleItems returns only the displayed columns as array. 

Getter
function columns(): [Column]
Setter
function setColumns(value: [Object|Column])
Code -1
    var cols = group.columns();
    if (cols.length <= 0) {
        group.setColumns([{
            name: 'col1',
            fieldName: 'fld1'
        },
        ...
        ]);
    }  
Note
The array returned through this property or visibleItems property is newly created whenever call property getter. When calling repeatedly, you should cache if possible.
See Also
visibleItems
count
visibleCount
layout
Examples
Column Grouping
Column Visibility