bStateSave not re-searching...
bStateSave not re-searching...
digitalfiz
Posts: 3Questions: 0Answers: 0
I have bStateSave set to true and it saves the text that was searched in the searchbox but the search is not done on the table when the page is refreshed. I have to type in the box or remove text in the search box before is starts filtering again. Am I doing something wrong? Here is the code I am using:
[code]
$('.deviceTable').dataTable({
"aoColumns": [
/* Checkall */ null,
/* Name */ null,
/* Description */ { "bVisible": false },
/* tags */ { "bVisible": false },
/* Map */ null,
/* Last Seen */ null,
/* Actions */ null
],
"bSort": false,
"bStateSave": true
});
[/code]
[code]
$('.deviceTable').dataTable({
"aoColumns": [
/* Checkall */ null,
/* Name */ null,
/* Description */ { "bVisible": false },
/* tags */ { "bVisible": false },
/* Map */ null,
/* Last Seen */ null,
/* Actions */ null
],
"bSort": false,
"bStateSave": true
});
[/code]
This discussion has been closed.
Replies
Thanks,
Allan
With bSort : false, reloading the page correctly sets the filter text but the filtering is not done.
No problem with bSort: true.
Bug seen with datatables 1.8.1, 1.8.2 and 1.8.3.dev.
By the way, thanks for this great program.
1.8.2 min version
have column filtering in use with "bStateSave": true
when the table reloads the column filtering is working and the data shown in the datatable reflects the filter that was last in use, and the result status correctly shows "Showing 0 to 0 of 0 entries (filtered from 3 total entries)"
however the search input field that contains the value to filter on is blank which causes some confusion since it is unclear how there are 3 total entries yet 0 results and no filtering appears to be at play.
not sure if this is a bug, or something that I need to handle on pageload
{"iCreate":1321554700688, "iStart":0, "iEnd":1, "iLength":10, "sFilter":"", "sFilterEsc":true, "aaSorting":[ [0, "desc"]], "aaSearchCols":[ ["", true], ["mi", true], ["", true], ["", true], ["", true], ["", true]], "abVisCols":[ true, true, true, true, true, true]}
the aaSearchCols subarray contains my search string of "mi", now I need to trap for any value in aaSearchCols on page load and populate the value of the input field for any value present. Is there a JS snippet available that does this? Or a suggested methodology to add this in?
bingo, search turns up the needed code here, 3rd post and 5th post: http://www.datatables.net/forums/discussion/992/solved-override-bstatesave-with-osearch-and-aosearchcols/p1
I'm good to go I think