Author Topic: Refresh page with 2 grids on same tab  (Read 303 times)

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 36
    • View Profile
Refresh page with 2 grids on same tab
« on: April 04, 2023, 12:42:55 am »
I am using jQuery tabs to switch from one queryparam grid page to another.  When I am on my detail page and I update numbers in that detail grid, I have code that does refreshDataAndView for the page I am going to.  This worked fine when I had just one queryparam grid page on the target tab.

However, I now have 2 queryparam grid pages on the target page and only the first grid is being refreshed using the code below:
$( "#ui-tabs" ).tabs(
   {
       activate: function (evt, ui) {
        var $grid = ui.newPanel.find(".pq-grid"),
                   sheet = $grid.data('sheet'),
                   grid = $grid.pqGrid('instance');
      
      grid.showLoading();
      grid.refreshDataAndView();
      
      grid.hideLoading();
        }
    }
);

What can I use to refresh multiple jqueryparam grids that are on the same "target" tab view??

Thanks,
Peter Bassey

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Refresh page with 2 grids on same tab
« Reply #1 on: April 04, 2023, 11:36:54 am »
This would refresh both data and view of all grids in the tab.

Code: [Select]
  ui.newPanel.find(".pq-grid").pqGrid( 'refreshDataAndView' );

and this would refresh all the grids in the tab.

Code: [Select]
  ui.newPanel.find(".pq-grid").pqGrid( 'refresh' );

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Refresh page with 2 grids on same tab
« Reply #2 on: April 04, 2023, 05:23:01 pm »
Thank you!  Worked perfectly...