Hi all,
I'm using a session variable to filter grids throughout the application; this variable can be set from a drop-down menu at the top of almost any page in the application. In the OnGridExecute event I am checking the session variable and, based on this, modifying the value of e.rv.tmpl.CS.SQL to get the dataset I need. This works fine most of the time but if a user opens two tabs and changes the session variable in the second, returning to the first and (for example) searching the grid or changing it's page will cause OnGridExecute to change the grid's dataset; once a page has been loaded I want it to keep using the filter it started with.
I first tried storing values for re-use in the e and rtc objects, but these were not preserved between callbacks. I then tried using e._state and found this wiki page which explained why my method wasn't working and appeared to present a solution; however, it doesn't seem possible to cause an AJAX response from OnGridExecute using the method described (can anyone confirm this? I couldn't get a simple JavaScript alert to be returned).
I'm now feeling a bit stuck on this, so any help would be greatly appreciated. Preferably I'm looking for a solution which only requires I make changes in OnGridExecute as I will need to update a large number of pages once a solution is found, ultimately though I just need a way of preserving a variable between callbacks from the same page.
Thanks for reading,
dorobe
I'm using a session variable to filter grids throughout the application; this variable can be set from a drop-down menu at the top of almost any page in the application. In the OnGridExecute event I am checking the session variable and, based on this, modifying the value of e.rv.tmpl.CS.SQL to get the dataset I need. This works fine most of the time but if a user opens two tabs and changes the session variable in the second, returning to the first and (for example) searching the grid or changing it's page will cause OnGridExecute to change the grid's dataset; once a page has been loaded I want it to keep using the filter it started with.
I first tried storing values for re-use in the e and rtc objects, but these were not preserved between callbacks. I then tried using e._state and found this wiki page which explained why my method wasn't working and appeared to present a solution; however, it doesn't seem possible to cause an AJAX response from OnGridExecute using the method described (can anyone confirm this? I couldn't get a simple JavaScript alert to be returned).
I'm now feeling a bit stuck on this, so any help would be greatly appreciated. Preferably I'm looking for a solution which only requires I make changes in OnGridExecute as I will need to update a large number of pages once a solution is found, ultimately though I just need a way of preserving a variable between callbacks from the same page.
Thanks for reading,
dorobe
Comment