Author Topic: clear/refresh multiple pqgrid object on the same page  (Read 3232 times)

amynkvirani

  • Newbie
  • *
  • Posts: 3
    • View Profile
clear/refresh multiple pqgrid object on the same page
« on: June 28, 2017, 07:19:14 pm »
So I have a primary pqgrid object on the main page and on editing one of the rows, a jquery popup appears with the data corresponding to that row which includes few text fields and another pqgrid.

The first time I click edit, the inner grid is loaded correctly with the correct data. But upon closing the dialog and editing a different row, the grid loads up empty without any data.

In order to debug, this is how my getData of dataModel looks like:

Code: [Select]
getData: function (response) {
    console.log(customerId);
    console.log(response);
    return { data: response };
}

It prints the correct customerId and also the correct response from the server but still the rows aren't populated.

Any help is appreciated. Please let me know if you would like to see more code for better understanding.

Thanks.

amynkvirani

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: clear/refresh multiple pqgrid object on the same page
« Reply #1 on: June 28, 2017, 09:24:42 pm »
Here is a link to replicate the issue

http://jsfiddle.net/amynkvirani/h67Lum7L/8/

Select a random row and click edit. The new grid populates just fine. Close the dialog and edit a different row. The new grid shows no records. Open your browser console to confirm that the new data is coming from the webservice.

amynkvirani

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: clear/refresh multiple pqgrid object on the same page
« Reply #2 on: June 29, 2017, 09:18:23 pm »
So what I found out was if I change the pageModel for the inner grid to use type: remote instead of local, it worked fine as it should. But I do not want pagination to work from remote and instead the local should have all the records at once and perform pagination locally.

Any help is highly appreciated.

Thanks.