sSearch gets cleared after init?
sSearch gets cleared after init?
Greetings, and thank you for this amazing plug-in!
I am trying to access the original value of sSearch after a table is initialized and the filter field value is cleared. After init it is empty both in my original options object and in fnSettings, even though it is not empty at compile time (and otherwise works predictably).
Here is relevant code:
[code]
options: {
'oSearch' : { 'sSearch' : 'incomplete' }
}
$('#table').dataTable(options); // table successfully auto-filters with 'incomplete'
...
var oTable = $('#table').dataTable();
console.log(options) // => oSearch.sSearch : ""
console.log(oTable.fnSettings()) // => oInit.oSearch.sSearch : ""
[/code]
I can store this initial value elsewhere, but it would be nice to be able to access the original options object, unmodified. Anyone have thoughts on this?
Many thanks!
I am trying to access the original value of sSearch after a table is initialized and the filter field value is cleared. After init it is empty both in my original options object and in fnSettings, even though it is not empty at compile time (and otherwise works predictably).
Here is relevant code:
[code]
options: {
'oSearch' : { 'sSearch' : 'incomplete' }
}
$('#table').dataTable(options); // table successfully auto-filters with 'incomplete'
...
var oTable = $('#table').dataTable();
console.log(options) // => oSearch.sSearch : ""
console.log(oTable.fnSettings()) // => oInit.oSearch.sSearch : ""
[/code]
I can store this initial value elsewhere, but it would be nice to be able to access the original options object, unmodified. Anyone have thoughts on this?
Many thanks!
This discussion has been closed.