Author Topic: Grid doesn't load when moving to another tab  (Read 1820 times)

Sivakumar

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 32
    • View Profile
Grid doesn't load when moving to another tab
« on: February 19, 2020, 04:46:59 pm »
Hi,
I am trying to bind different grid on 3 different tabs.
It's getting bind correctly on first tab but is not loading for the other two tabs.
Calling the same BindGrid method for all the 3 grids with varying id's for each grid.


Uncaught TypeError: Cannot read property 'wdCenter' of undefined
    at pq.cRenderBody.refreshColumnWidths (pqgrid.min.js:11)
    at pq.cRenderBody.init (pqgrid.min.js:19)
    at t.paramquery.cRefresh.refresh (pqgrid.min.js:12)
    at pqgrid.min.js:12
    at pqgrid.min.js:12

Let me know if anything else is required.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Grid doesn't load when moving to another tab
« Reply #1 on: February 19, 2020, 10:03:11 pm »
1. Same initialization object should not be shared between different grids.

2. Refresh grid whenever corresponding  tab is activated.

Code: [Select]
$("#tabs").tabs({
    activate: function(evt, ui) {
      //important to refresh grid whenever corresponding  tab is activated.
      ui.newPanel.find(".pq-grid").pqGrid("refresh");
    }
})

Please share a small test case via jsfiddle if that doesn't resolve the error.
« Last Edit: February 19, 2020, 10:44:43 pm by paramvir »