searchBuilder.rebuild()
Rebuild the search to a given state.
Please note - this property requires the SearchBuilder extension for DataTables.
Description
This method provides the ability to set the search in SearchBuilder.
searchBuilder.rebuild()
takes one argument, it is an SearchBuilder.Criteria
object which defines the search logic to be applied.
If no argument is given, the search will be cleared.
Type
function searchBuilder.rebuild( [state, [redraw]] )
- Description:
Rebuilds the search to be the same as that provided by the
details
parameter.- Parameters:
Name Type Optional 1 state
Yes State to apply to SearchBuilder.
2 redraw
Yes - default:true Since 1.8.2: Indicate if the host DataTable should be redrawn or not.
- Returns:
DataTables API instance
Example
Get the details of a Search::
var stored;
var table = new DataTable('#myTable', {
layout: {
top1: 'searchBuilder'
}
});
$('#getDetails').on('click', function () {
stored = table.searchBuilder.getDetails();
});
$('#revert').on('click', function () {
table.searchBuilder.rebuild(stored);
});
Related
The following options are directly related and may also be useful in your application development.