Author Topic: Double request on load restore saved settings  (Read 2247 times)

WTC_User

  • Pro OEM
  • Newbie
  • *
  • Posts: 18
    • View Profile
Double request on load restore saved settings
« on: October 20, 2017, 02:29:05 pm »
Hi again,

I found the references to save and load grid's state at this page: https://paramquery.com/pro/demos33/grid_state
I'm going to explain the problem.
I've a table with REMOTE data and REMOTE paging and I need to save its settings and restore them when the table appear. So it's like the demo (link) but with remote paging so this:
create: function () {
       //restore state of grid.                               
       loadStateSuccess = this.loadState({ refresh: false });
},

will become:

create: function () {
       //restore state of grid.                               
       loadStateSuccess = this.loadState({ refresh: true});
},

I saw that the library apply the settings after the first call with that conseguences:
- the backend will receve the uncorrect request and the correct one so increase the BE side's work.
- If the response arrive fast I can see for an instant the uncorrect data before the new data (and correct) arrives.
- the user will have a bad experience of our product

We have Paramquery Pro v.3.3.5.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: Double request on load restore saved settings
« Reply #1 on: October 20, 2017, 10:25:17 pm »
The first request always get cancelled no matter how fast the back end server because it's an asynchronous request and the grid cancels any pending request before initiating any new remote request.

It's only the response to the 2nd request ( initiated by loadState ) which actually arrives through the network and displayed in the grid.
« Last Edit: October 20, 2017, 11:33:43 pm by paramquery »