Cannot get state saving to work
Cannot get state saving to work
lamhe
Posts: 1Questions: 0Answers: 0
Hi,
I have just installed version 1.9. This is a awesome datatable. I am very new to the product.
I cannot get state saving to work.
First of all. The server is a ASP.NET MVC3 application
Datatable setup is:
server side processing with ajax.
x and y scrolling.
bScrollCollapse = true
bScrollInfinite = true
bPaginate = true
i have also defined aoColumns
The datatable is empty when i load the page. I have only a thead defined.
Let me explain my form.
It consists of a couple input text boxes and a search button.
The user fills the text boxes and i use those in my query to the server.
So when the user presses the search i will call Draw(), The datatable is set up with
Datatable.fnSettings().fnServerData callback.
Every thing is working fine.
Just before the call to the server i store my the query data in a cookie called "LastQuery"
The results could be up to 1000 rows. i only show 30 rows window. Then the user has to scroll. The datatable works fine.
--
The state saving issue
So please correct med if i am wrong.
stateSaveParams
Here i will store the object with create...., iStart... iEnd and so in a cookie for now. The cookie is called "LoadedState"
stateSave
Since the server already have the last query in its cache, i dont store anything here.
stateLoad
Here i read my cookie called "LastQuery" and execute a get to the server.
In return i get the array of data from the server (cached of course) and return it to the caller, using synchronous call
But here i get a exception (alert) saying .... something about unable to get the value of the property slice, object is null or undefined.
When i debug the code it seems that the caller want to have the object with create...., iStart... iEnd and so on.
I can see in your documentation that i should return a json object here. The json object that i return is my data array that should be populated to the datatable.
Please correct me if im wrong.
stateLoadParams
Doing nothing
stateLoaded
Doing nothing
---
I am quite new to the product and i have tried to look for more examples.
Rgds Henrik
I have just installed version 1.9. This is a awesome datatable. I am very new to the product.
I cannot get state saving to work.
First of all. The server is a ASP.NET MVC3 application
Datatable setup is:
server side processing with ajax.
x and y scrolling.
bScrollCollapse = true
bScrollInfinite = true
bPaginate = true
i have also defined aoColumns
The datatable is empty when i load the page. I have only a thead defined.
Let me explain my form.
It consists of a couple input text boxes and a search button.
The user fills the text boxes and i use those in my query to the server.
So when the user presses the search i will call Draw(), The datatable is set up with
Datatable.fnSettings().fnServerData callback.
Every thing is working fine.
Just before the call to the server i store my the query data in a cookie called "LastQuery"
The results could be up to 1000 rows. i only show 30 rows window. Then the user has to scroll. The datatable works fine.
--
The state saving issue
So please correct med if i am wrong.
stateSaveParams
Here i will store the object with create...., iStart... iEnd and so in a cookie for now. The cookie is called "LoadedState"
stateSave
Since the server already have the last query in its cache, i dont store anything here.
stateLoad
Here i read my cookie called "LastQuery" and execute a get to the server.
In return i get the array of data from the server (cached of course) and return it to the caller, using synchronous call
But here i get a exception (alert) saying .... something about unable to get the value of the property slice, object is null or undefined.
When i debug the code it seems that the caller want to have the object with create...., iStart... iEnd and so on.
I can see in your documentation that i should return a json object here. The json object that i return is my data array that should be populated to the datatable.
Please correct me if im wrong.
stateLoadParams
Doing nothing
stateLoaded
Doing nothing
---
I am quite new to the product and i have tried to look for more examples.
Rgds Henrik
This discussion has been closed.