ColumnStore
A store specialized in handling columns. Used by the Grid to hold its columns and used as a chained store by each SubGrid to hold theirs. Should not be instantiated directly, instead access it through grid.columns or subGrid.columns.
Observing for changes
If you want to listen for changes to the columns in the ColumnStore. For example, if you are interested in when a column has been moved, simply use the on method to listen for the move event:
grid.columns.on({
move({ records }) {
// The `records` object contains the moved column records
}
});
Modifying columns in the ColumnStore
// resize first column
grid.columns.first.width = 200;
// remove city column
grid.columns.get('city').remove();
// add new column
grid.columns.add({text : 'New column'});
// add new column to specific region (SubGrid)
grid.columns.add({text : 'New column', region : 'locked'});
// add new column to 'locked' region (SubGrid)
grid.columns.add({text : 'New column', locked : true});
Storing column state
To store the size and position of columns after a user makes a change, please see GridState.
Useful functions
| Member | Description |
|---|---|
| add | Add a column to the grid |
| remove | Remove column(s) from the grid |
| get | Get a column by its id or field name |
| visibleColumns | Array of currently visible columns |
See also
Configs
Configs are options you supply in a configuration object when creating an instance of this classProperties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ColumnStore class, or subclass thereof.
-
Bottom columns are the ones displayed in the bottom row of a grouped header, or all columns if not using a grouped header. They are the columns that actually display any data.
-
Returns the top level columns. If using grouped columns, this is the top level columns. If no grouped columns are being used, this is the leaf columns.
-
Checks if any column uses autoHeight
-
Checks if any flex column uses autoHeight
-
Returns the visible leaf headers which drive the rows' cell content.
-
Identifies an object as an instance of ColumnStore class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
createRecord( )private
Used internally to create a new record in the store. Creates a column of the correct type by looking up the specified type among registered columns.