Search-Builder-Bug?
Search-Builder-Bug?
Hello.
I use the Search-Builder and save the state to my Database (so the user can save different user-filters). After loading the state again, I always got the error
**DataTables warning: table id=tabelle - Unknown paging action: 0. For more information about this error, please see http://datatables.net/tn/5**
So I took a look in the saved datas and saw, that the last entry is always ...,"page":"0"}
As if the page should be a certain string ('first, 'last', ... or an integer, I changed the data to ...,"page":0} and it is working perfecly. But DataTables itself saves the state still with ...,"page":"0"}. I made a workaround by parsing "0" to 0, but it seems to be like a little bug in the SearchBuilder-StateSaver.
Greetings from Hannover
Replies
I created a test case for you with SearchBuilder:
http://live.datatables.net/qokonicu/1/edit
After performing a search and reloading the page I see this output from the retrieved state data:
And using console.log(typeof data.page) the result is
number
.Are you storing the data somewhere using
stateSaveCallback
? If so maybe the the page value is being changed to a string in your storage location or when its retrieved. Can you post a link to your page or a test case showing the issue?https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I create the Datatable with that code:
And onclick I save the tabdata to the database via
and
Have you traced through all the statesave steps to see where the
page
property is a string ("0")?Maybe try the
stateLoadParams
andstateSaveParams
events, like this:Kevin
You are right. I lose the int-type by postig the json as an array...
Thank you for your help!