jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Retaining filters on reloading the grid
Tagged: angularjs grid, datagridview, grid, gridview, jquery grid, jquery gridview
This topic contains 7 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 1 month ago.
-
Author
-
Hi,
Based on the changes in the jqxslider column, I have to update another cell value in the jqxgrid by hitting the DB(We can get the updated value from DB only). Because of getting the updated value from DB, I am reloading the grid again. So obviously, the properties like filters, sorting etc. will not retain.
Is there any possibility to retain the filters or updating a single cell value of the grid by getting it from DB.Thanks,
VijiHi Viji,
Why don’t you get the updated DB value through Ajax so you won’t need to reload your Grid?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPeter,
SO in cellsrenderer function of that particular cell, we can make ajax calls. If we need to update 2 cell values on changing the jqxslider column also, we can make use of this approach? If so, please share a sample for the same.
Thanks,
VijiHi Viji,
I did not mean in cellsrenderer to make Ajax call. If you change a Value, you should update your DB value within “updaterow” callback function of the source object. cellsrenderer purpose is to display HTML and only that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I don’t want to update my DB. I just want to send the updated value (id) as a input parameter and fetch the other details from DB for that id and reload it in the same row(just 2 cells). Will “updaterow” callback function works for this scenario?Thanks,
VijiHi Viji,
Then make an Ajax call to your server and call the Grid’s updaterow method to update the Row values, but don’t do that inside “rendering” functions, because you will cause re-render and you’ll end up with infinite loop and crashed browser.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThank you so much for the solution Peter. Could you please share a sample to follow the same as you are saying not to do inside the rendering functions.
Thanks,
VijiHi Viji,
Here’s a help topic with Cell Editing. When Grid cell is edited, the Grid’s updaterow function is called and then there’s in the code a jQuery Ajax call. The server listens for such calls and updates the DB when it receives such request. The link to the Grid’s help topic is: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/phpintegration/php-server-side-grid-editing.htm
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.