stateRestore.bookmark
Since: StateRestore 2.2.0
Bookmark configuration object.
Please note - this property requires the StateRestore extension for DataTables.
Description
This object is the container for the configuration of StateRestore's bookmarking feature. To enable this feature you must set stateRestore.bookmark.src, but it also has other parameters that can be used to customise as you need:
stateRestore.bookmark.match- Match on state id or namestateRestore.bookmark.src- Query / search parameter or hash to identify the statestateRestore.bookmark.update- Control URL rewriting when changing state.
Please refer to the documentation for each for full details.
Type
object
Configuration object for the bookmark feature of StateRestore.
Examples
Enable bookmark support, using a query string parameter:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['stateCreate', 'statesList', 'pageLength']
}
},
stateRestore: {
bookmark: {
src: '?dtsr'
}
}
});Enable bookmark support using a URL hash:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['stateCreate', 'statesList', 'pageLength']
}
},
stateRestore: {
bookmark: {
match: 'name',
src: '#dt-'
}
}
});Related
The following options are directly related and may also be useful in your application development.