Class: Grid

Components.Grid

new Grid()

Source:
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
Source:

(static) self.activeSort :Components.GridSort

Currently applied sort on dataset
Type:
Source:

(static) self.items :array

Contains array of currently filtered items
Type:
  • array
Source:

(static) self.state :object

Stores saved values to be stored in URL
Type:
  • object
Source:

(static) sorts :array

Maintains list of added sorters
Type:
  • array
Source:

(inner) self

Reference to current Grid
Source:

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
Source:

(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
Source:

(static) clearFilters()

Iterates through all filters and clears out their options
Source:

(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}
Source:

(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
Source:

(static) self.printDescription()

Generate a description of the applied filters for printing.
Source:
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.
Source:

(inner) $onInit()

Initializes the component.
Source: