Creates a new controller for a table with the given numer of columns.
the columns as a list of pairs of column key and column label. Labels may be functions which are invoked with the table controller as this and the key as argument if a label is required.
the initial sort key
the initial sort order
A convenience function that inserts word breaks
(​) before every dot in the given text
and returns the result.
the text
A convenience method for clearing an input element
that is used to specify a filter. Searches for
an input element in the event.target's enclosing
elements and sets its value to the empty string.
the event
Sort and filter the given data according to the current state of the controller. Returns the sorted data.
Sets a filter for the data.
the string to match
Returns the column label for the given column key.
the column key
This method sets the primary sort key. If the order is
undefined, and the current sort key is the same as the
specified key, the current sort order is inverted.
the column key
Optionalorder: string
the sort order ('up' for ascending
and 'down' for descending) or undefined
Returns true if given key is the current sort key
and the current sort order for is ascending.
the column key
Returns true if given key is the current sort key
and the current sort order for is descending.
the column key
Returns the sort order of the column with the given key (1 for "up" and -1 for "down").
the column key
A convenience method to update the filter from the value of the passed in event.
the event which must have a currentTarget
with a value attribute.
A generic controller for tables. It provides information about the available columns and maintains state regarding their sort order and direction. In addition, it supports simple filtering based on cell content.