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 class-
Commit changes automatically
Has a corresponding runtime autoCommit property.
-
Initial groupers, specify to have store grouped automatically after initially setting data
Has a corresponding runtime groupers property.
-
Store's unique identifier. When set the store is added to a store map accessible through
Store.getStore(id).Has a corresponding runtime id property.
-
Set to
falseto not record transaction duringapplyChangesetcallHas a corresponding runtime ignoreRemoteChangesInSTM property.
-
Prevent dynamically subclassing the modelClass. It does so by default to not pollute it when exposing properties. Should rarely need to be used.
-
Reference to STM manager
-
A Collection, or Collection config object to use to contain this Store's constituent records.
-
Internal listeners, that cannot be removed by the user.
-
Specify
trueto reapply filters when a record is added to or moved within the store. This includes tree node operations like indent/outdent in Gantt, or any move operation that changes a node's parent. -
Specify
trueto reapply filters when a record is updated in the store. You can also provide an array of field names, to only re-filter when certain data fields are updated.- fields : String[]
Fields
- fields : String[]
-
The name of the parameter to use when requesting pages of data using the zero based index of the required page's starting record.
-
The name of the parameter to use when requesting pages of data, representing the configured pageSize value.
-
The name of the parameter to use when requesting pages of data using the one based page number required.
-
Specify true to sort this store after records are added.
-
When set to
true, restores the expanded states of tree nodes when reloading data. -
Automatically detect from set data if used as tree store or flat store. If tree is explicitly set to
false, then this value will be overruled and no tree detection performed. -
Set to
trueto fire a 'remove' event when moving a node (to mimic the behavior of versions < 6.0). -
trueto act as a tree store.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ColumnStore class, or subclass thereof.
-
Identifies an object as an instance of Events class, or subclass thereof.
-
Identifies an object as an instance of StoreCRUD class, or subclass thereof.
-
Identifies an object as an instance of StoreChained class, or subclass thereof.
-
Identifies an object as an instance of StoreChanges class, or subclass thereof.
-
Identifies an object as an instance of StoreFilter class, or subclass thereof.
-
Identifies an object as an instance of StoreGroup class, or subclass thereof.
-
Identifies an object as an instance of StorePaging class, or subclass thereof.
-
Identifies an object as an instance of StoreRelation class, or subclass thereof.
-
Identifies an object as an instance of StoreSearch class, or subclass thereof.
-
Identifies an object as an instance of StoreSort class, or subclass thereof.
-
Identifies an object as an instance of StoreSparseIndex class, or subclass thereof.
-
Identifies an object as an instance of StoreState class, or subclass thereof.
-
Identifies an object as an instance of StoreStm class, or subclass thereof.
-
Identifies an object as an instance of StoreSum class, or subclass thereof.
-
Identifies an object as an instance of StoreSync class, or subclass thereof.
-
Identifies an object as an instance of StoreTree class, or subclass thereof.
-
A class property getter for the default values of internal properties for this class.
-
Get all registered stores
-
Store's unique identifier.
Has a corresponding id config.
-
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.
-
Returns the root store in the chain — the store that is not itself chained. For a store chained off another chained store, this walks up the full chain. Returns
thisif the store is not chained. -
Set to
falseto not record transaction duringapplyChangesetcallHas a corresponding ignoreRemoteChangesInSTM config.
-
Is this a chained store?
-
Returns
trueif the data in this store depends on a remote data source. That is this Store is an AjaxStore, or uses requestData, or is chained off an AjaxStore. -
An empty array that can be used as a default value.
-
An empty object that can be used as a default value.
-
Identifies an object as an instance of ColumnStore class, or subclass thereof.
-
Identifies an object as an instance of Store class, or subclass thereof.
-
Returns a copy of the full configuration which was used to configure this object.
-
This property is set to
truebefore theconstructorreturns. -
This property is set to
trueon entry to the destroy method. It remains on the objects after returning fromdestroy(). If isDestroyed istrue, this property will also betrue, so there is no need to test for both (for example,comp.isDestroying || comp.isDestroyed). -
Returns all locally available records from the store, ignoring any filters and including grouping headers / footers.
-
Setting
autoCommittotrueautomatically commits changes to records.Has a corresponding autoCommit config.
-
Get the first record locally available in the store.
-
Get the last record locally available in the store.
-
Class used to represent records. Defaults to class Model.
Has a corresponding modelClass config.
-
Returns all locally available "visible" records. Note: The returned value may not be mutated!
-
Yields the complete dataset size, ignoring filtering and grouping. If the store is paged, it returns the
totalvalue provided in the page load request response, or manually set. -
Currently applied filters. A collection of CollectionFilter instances.
Has a corresponding filters config.
-
Currently used groupers. To set groupers when remote sorting is enabled by sortParamName you should use setGroupers instead to be able to wait for the operation to finish.
Has a corresponding groupers config.
-
Check if store is filtered
-
Is store currently grouped?
-
Is store sorted?
-
Currently applied sorters
Has a corresponding sorters config.
-
Pretty printed version of json
-
Returns all the group header records
-
If the store is paged, yields the current page number.
-
The sorter function for sorting records in the store.
-
trueif this Store is configured to handle tree data (withtree : true) or if this is a chained store and the master store is a tree store. -
Returns all leaf records in a tree store
-
The invisible root node of this tree.
Functions
Functions are methods available for calling on the class-
This optional class method is called when a class is mixed in using the mixin() method.
-
Registers this class type with its Factory
-
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.
-
Clears store data. Used by removeAll, separate function for using with chained stores.
-
Updates records available in a chained store by filtering the master store records using chainedFilterFn
-
Internal function used to hook destroy() calls when using thisObj
-
Internal function used restore hooked destroy() calls when using thisObj
-
Auto detaches listeners registered from start, if set as detachable
-
Internal function used to run a callback function after an event is triggered
-
Removes all listeners registered to this object by the application.
-
Resumes automatic commits upon store changes. Will trigger commit if the internal counter is 0.
-
Suspends automatic commits upon store changes. Can be called multiple times (it uses an internal counter).
-
Accepts all changes, resets the modification tracking:
- Clears change tracking for all records
- Clears added
- Clears modified
- Clears removed Leaves the store in an "unmodified" state.
-
Handles changes in master stores data. Updates the chained store accordingly
-
Handles refresh events from the master store. During batch operations, individual change events are suppressed and only a refresh event with
action: 'batch'fires afterendBatch(). This ensures the chained store stays in sync after batch operations. -
Relays some function calls to the master store
-
Initialized relations, called from constructor
-
Updates relationCache for all records.
-
Sets a collection of related records. Will updated the related store and trigger events from it. Not to be called directly, called from Model setter.
-
Updates relation cache and foreign key value when a related objects id is changed.