infoCallback
Table summary information display callback.
Description
This option can be used to customise the display text of the info
feature of DataTables.
It is an alias to info.callback
, which should be preferred when using DataTables 2+. If multiple info
features are used for a table, infoCallback
will be used for all of them, while info.callback
is unique to each instance.
Type
function infoCallback( settings, start, end, max, total, pre )
- Parameters:
Name Type Optional 1 settings
No DataTables settings object
2 start
No Starting position in data for the draw
3 end
No End position in data for the draw
4 max
No Total number of rows in the table (regardless of filtering)
5 total
No Total number of rows in the data set, after filtering
6 pre
No The string that DataTables has formatted using its own rules
- Returns:
The string to be displayed in the information element.
Example
Show start to end indexes in the information element:
new DataTable('#myTable', {
infoCallback: function (settings, start, end, max, total, pre) {
return start + ' to ' + end;
}
});
Related
The following options are directly related and may also be useful in your application development.