searchBuilder.conditions[type][cond]
The object structure for additional conditions for SearchBuilder.
Please note - this property requires the SearchBuilder extension for DataTables.
Description
This is useful as it allows custom conditions to be added to SearchBuilder should the standard ones not be enough. It also allows for the standard conditions to be removed or edited to fit your own needs. Here the type
in searchBuilder.conditions[type][cond]
is the type for the column, for more details refer to columns.type
.
This object is used to represent a single condition. It is an object which contains 5 properties which define fully the behaviour of the condition. They are as follows
searchBuilder.conditions[type][cond].conditionName
The string that is to be displayed in the option for this condition.searchBuilder.conditions[type][cond].init
This function is used to initialise the value elementsearchBuilder.conditions[type][cond].inputValue
This function is used to return the value that the values from the table should be compared againstsearchBuilder.conditions[type][cond].isInputValid
This function is used to determine if the criteria should be used in the overall filtersearchBuilder.conditions[type][cond].search
This is the function that compares the row data and the value selected in this criteria.
The standard conditions can be removed, edited or added to. The manual page for custom conditions covers this in detail.
Note: Please also not that custom conditions are not supported when the serverSide
option is set to true.
Examples
There are two examples that create custom conditions using initialisation options. They both show how to add a custom condition to the num
column type, but the process is the same for other column types.
There is also an example that shows how to use a plug-in to add a custom condition.
Type
Default
- Value:
object
Related
The following options are directly related and may also be useful in your application development.