new Grid()
Example
<grid raw-items="dataToFilter" on-update="onUpdate(items, state)"></grid>
Members
(static) filters :array
Maintains list of added filters. A filter can be a Components.GridFilter or
Components.GridSearch
Type:
- array
(static) self.activeSort :Components.GridSort
Currently applied sort on dataset
Type:
(static) self.items :array
Contains array of currently filtered items
Type:
- array
(static) self.state :object
Stores saved values to be stored in URL
Type:
- object
(static) sorts :array
Maintains list of added sorters
Type:
- array
(inner) self
Reference to current Grid
Methods
(static) addFilter(filter)
When first loading, all child grid-filter components will call this method to add
themselves to this controller.
Parameters:
Name | Type | Description |
---|---|---|
filter |
Components.GridFilter | Instance of a GridFilter component |
(static) addSort(sort)
When sorts first load, they will add themselves to this controller using this method
Parameters:
Name | Type | Description |
---|---|---|
sort |
Components.GridSort | Instance of a GridSort component |
(static) clearFilters()
Iterates through all filters and clears out their options
(static) doFilter()
Iterates through all the results obtained from all child grid filters and
executes all filter funcs to reduce the data to a single dataset
To describe somewhat visually, imagine if we have two filters
Agency may result with a data set containing {1, 2, 3, 4}
while
DeploymentModel may contain a dataset with {a,b,c}
However, if we apply the filterfunc from each filter to every single data point,
we may end up with {1,2,a,c}
(static) doUpdate(state)
Updates the state information for the grid by storing saved filters and sorting information in the $location.search().
Then executes the callback method to pass back state and list of items to calling clients.
Parameters:
Name | Type | Description |
---|---|---|
state |
object | Object containing key/value data to add to the state |
(static) self.printDescription()
Generate a description of the applied filters for printing.
Returns:
A human readable description of the filters applied
(static) updateSort()
Updates the state of all sorts so that the latest one used is the only one that's
activated.
(inner) $onInit()
Initializes the component.