This PR adds filtering and searching to the sortable-table view.
In order to search a column, a data-sortable-search-type='some_type' must be added to its th.
Right now there are a handful of search "types".
text: will display a search input
select: will show a select box with options aggregated from the given column
multi-select: will show a button top open a multi-select dialog with options aggregated from the given column
In the case that no search type is given, a td with an hidden field is inserted so that when we collect search criteria, the index of each bit of data is the same as the column number.
The filtering is preformed by:
Create a copy of the table body as a documentFragment.
Duplicate that fragment
Compare each of the rows with an array of input data
If the text from every field is present in every cell, we consider that row a match
If it is not, we remove it from the copied fragment
Once we have compared every row, we replace the table body with the copied fragment
This PR adds filtering and searching to the sortable-table view.
In order to search a column, a
data-sortable-search-type='some_type'
must be added to itsth
.Right now there are a handful of search "types".
text
: will display a search inputselect
: will show a select box with options aggregated from the given columnmulti-select
: will show a button top open a multi-select dialog with options aggregated from the given columnIn the case that no search type is given, a
td
with an hidden field is inserted so that when we collect search criteria, the index of each bit of data is the same as the column number.The filtering is preformed by:
documentFragment
.