Methods
-
filterHandler( data, filters, columns ) → {Promise.<(Array.<TRow>|*)>}
-
Description
Filter the provided rows, checking if at least a cell contains one of the specified filters. It supports promises. Defaults to Handler#defaultFilterHandler.Parameters
Name Type Description data
Array.<TRow> | * The data to apply filter on. It is usually an array of rows, but it can be whatever you set in the Datatable#data property. filters
Array.<string> | string | undefined The strings to search in cells. columns
Array.<Column> The columns of the table. Returns
Details
-
sortHandler( filteredData, sortColumn, sortDir ) → {Promise.<(Array.<TRow>|*)>}
-
Description
Sort the given rows depending on a specific column & sort order. It suports promises. Defaults to Handler#defaultSortHandler.Parameters
Name Type Description filteredData
Array.<TRow> | * Data outputed from Handler#filterHandler. It is usually an array of rows, but it can be whatever you like. sortColumn
Column The column used for sorting. sortDir
'asc' | 'desc' | null The direction of the sort. Returns
Details
-
paginateHandler( sortedData, perPage, pageNumber ) → {Promise.<(Array.<TRow>|*)>}
-
Description
Split the rows list to display the requested page index. It supports promises. Defaults to Handler#defaultPaginateHandler.Parameters
Name Type Description sortedData
Array.<TRow> | * Data outputed from Handler#sortHandler. It is usually an array of rows, but it can be whatever you like. perPage
number The total number of items per page. pageNumber
number The index of the page to display. Returns
Details
-
displayHandler( processSteps ) → {Promise.<DisplayHandlerResult>}
-
Description
Handler to post-process the paginated data, and determine which data to actually display. It supports promises. Defaults to Handler#defaultDisplayHandler.Parameters
Name Type Description processSteps
object The result of each processing steps, stored in an object. Each step is the result of one of the processing function (Handler#filterHandler, Handler#sortHandler, Handler#paginateHandler), applied on the previous step. Name Type Description source
Array.<TRow> | * The original Datatable#data property of the datatable. filtered
Array.<TRow> | * The return value of Handler#filterHandler. sorted
Array.<TRow> | * The return value of Handler#sortHandler. paged
Array.<TRow> | * The return value of Handler#paginateHandler. Returns
Details
-
defaultFilterHandler( data, filters, columns ) → {Promise.<Array.<TRow>>}
-
Description
Filter the provided rows, checking if at least a cell contains one of the specified filters.Parameters
Name Type Description data
Array.<TRow> The data to apply filter on. filters
Array.<string> | string | undefined The strings to search in cells. columns
Array.<Column> The columns of the table. Returns
Details
-
defaultSortHandler( filteredData, sortColumn, sortDir ) → {Promise.<Array.<TRow>>}
-
Description
Sort the given rows depending on a specific column & sort order.Parameters
Name Type Description filteredData
Array.<TRow> Data outputed from Handler#filterHandler. sortColumn
Column The column used for sorting. sortDir
'asc' | 'desc' | null The direction of the sort. Returns
Details
-
defaultPaginateHandler( sortedData, perPage, pageNumber ) → {Promise.<Array.<TRow>>}
-
Description
Split the rows list to display the requested page index.Parameters
Name Type Description sortedData
Array.<TRow> Data outputed from Handler#sortHandler. perPage
number The total number of items per page. pageNumber
number The index of the page to display. Returns
Details
-
defaultDisplayHandler( processSteps ) → {Promise.<DisplayHandlerResult>}
-
Description
Handler to post-process the paginated data, and determine which data to actually display.Parameters
Name Type Description processSteps
object The result of each processing steps, stored in an object. Each step is the result of one of the processing function (Handler#filterHandler, Handler#sortHandler, Handler#paginateHandler), applied on the previous step. Name Type Description source
Array.<TRow> | * The original Datatable#data property of the datatable. filtered
Array.<TRow> | * The return value of Handler#filterHandler. sorted
Array.<TRow> | * The return value of Handler#sortHandler. paged
Array.<TRow> | * The return value of Handler#paginateHandler. Returns
Details
-
rowMatches( row, filterString, columns ) → {boolean}
-
Description
Check if the provided row contains the filter string in *any* column.Parameters
Name Type Description row
TRow The data row to search in. filterString
string The string to match in a column. columns
Array.<Column> The list of columns in the table. Returns
Details