Author Topic: Another bug for hidden grids (with fix)  (Read 909 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 138
    • View Profile
Another bug for hidden grids (with fix)
« on: January 03, 2025, 06:05:19 pm »
If the grid is hidden when data is loaded, to fix I added the following:

Code: [Select]
getHeightR: function(ri, rows) {
if(typeof(ri)==="undefined") return 0;
...

getHeightCell: function(ri, rows) {
if(typeof(ri)==="undefined" || ri<0) return 0;

In the case above, I opened the grid, scrolled down a lot, closed the grid, new data was loaded and it went wrong trying to show it.

The pqGrid code has been written assuming that the grid is visible when data is loaded or a refresh is called.  This is obviously not always the case as sometimes the grid is prepared in the background for a better user experience.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6344
    • View Profile
Re: Another bug for hidden grids (with fix)
« Reply #1 on: January 06, 2025, 10:24:56 pm »
Data can be loaded in a hidden pqgrid and refresh can be safely called on it.

It would be great if you can share a jsfiddle or test case.