Server-Side Processing - sSearch = "null"
Server-Side Processing - sSearch = "null"
dlicorish
Posts: 7Questions: 0Answers: 0
The value passed server-side for the Search Box (sSearch) is not consistent. Initially, with no text in the Search field, sSearch is passed to the server as an empty string (""). However, if the box has been populated, then cleared, sSearch is passed as the string "null". Not sure if this is a bug or feature! ;-)
David
David
This discussion has been closed.
Replies
Is there a work-around?
Allan
Can't link to a page though as this is an internal app...
Allan
http://datatables.net/beta/1.9/examples/advanced_init/localstorage.html
Try typing a value, then erasing it and refreshing the page. The box will be populated with "null"
I actually just found a work-around by doing the following after the table init:
if($("#example_filter input").val()=="null"){
oTable.fnFilter( '' );
}
Allan
Allan
So the fix in DataTables is to cast the "empty string" to an empty string. Bonkers - but it works. Included in 1.9.1.
Allan