jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Jqxgrid State load issues after server filtering
Tagged: Grid State, server filtering
This topic contains 4 replies, has 2 voices, and was last updated by puneetdhingreja 8 years, 3 months ago.
-
Author
-
Hello,
I am loading the jqxgrid after performing filtering on the DB server.
I want to save this state, so that I can later retrieve it from the database, parse it (to form a DB query), perform filtering in the database and then load the grid . When the grid loads, it should highlight the rows on which the filtering was applied.Do I still need to make use of savestate and loadstate Apis?
I could achieve this when I was working with local data with filtering on the client side. I could save the state, via ‘savestate‘ api and load the grid via ‘loadstate‘ Api. However this doesn’t seem to work with url based loading of rows when i want to get the filtered data from server.
Please advise.
Hello puneetdhingreja,
When one or more columns are filtered they change the background color of each one, it is same with server filtering.
I would like to suggest you look at this demo for save and load state, it looks work fine:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/saveloadstate.htm?lightBest Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comHello Hristo,
Thanks for replying. I am aware that the columns change their background color. But when you save this state, and visit the grid again after reloading the page, and you want to load the previous persisted state by parsing it to form database queries and getting the filtered data from server, then this background color is not visible and also the columns lose the filter values from the filter options.When you work with local data, and all data is available to you at once, then this approach works fine with loadstate and savestate APis.
To make things easier to understand, I am doing the following.
1) I perform filtering on the DB server (not local data) when I Sort or Page or Apply filter on columns.
2) At this time the columns that I have applied filtering on, appear with changed background when the grid is loaded.
3) Now, I save this state by calling the savestate Api.
4) Next day, I come back to this page and see if there was a previous state saved for the grid, if yes, then I parse this state on the web server. I form queries from the saved state, hit the DB, get rows and populate the Grid. So , these rows are retrieved looking at data from saved state.
5) But now when the grid is loaded, I don,t see the changed color of the columns on which the filtering was applied, and neither do I see the column filter box retaining the filtered values.
6) This happens when I don’t have a loadstate APi called after I load the grid.
7) Because, If after loading the Grid from the server, I call loadstate on the state retrieved in step 4, then this makes another server call to the method which loads the grid initially.Did this help you in understanding the situation?
Hello puneetdhingreja,
Thank you for all your assistance, we will investigate this.
Also, I would like to ask you for more details (about the structure of the Grid), is there any error message?
Thanks again.Best Regards,
Hristo HristovjQWidgets team
http://www.jqwidgets.comThere is no error message from the grid
-
AuthorPosts
You must be logged in to reply to this topic.