ParamQuery grid support forum
General Category => Bug Report => Topic started by: jplevene on October 21, 2024, 08:12:06 pm
-
When a grid is displayed inside a hidden div like a dialog, tab, accordian, etc, there is a bug on line 28717
var top = this.topArr[ri],
Changing it to below fixes it:
var top = this.topArr ? this.topArr[ri] : 0,
-
Please share a jsfiddle.
-
I did this in a few minutes. It doesn't show all the bugs, but you get the drift
https://jsfiddle.net/jplevene/xa615pn7/
refreshDataAndView does not refresh if the view by establishing new widths and heights if it was previously hidden
-
It works fine: https://jsfiddle.net/jLd1eh26/
-
Found the issue, it is the height parameter. Does not work if "100% - 2", but it does for "100%". It is supposed to work with both. The 2 allows for the extra pixels taken up by the border.
https://jsfiddle.net/jplevene/xa615pn7/5/ (https://jsfiddle.net/jplevene/xa615pn7/5/)
Used your source for v10.0.0 and it worked. Have to find what my grid did that caused the issue (https://jsfiddle.net/jplevene/xa615pn7/9/ (https://jsfiddle.net/jplevene/xa615pn7/9/))
My fix just makes sure that "this.topArr" is set instead of causing a crash which happens when it is undefined, and for some reason in what is my very complex grid, it is not. (I tried to simplify the grid in my examples)
-
Found out how to get the bug
https://jsfiddle.net/v0418zyj/1/
Before you click the show button, open the browser console then resize the screen. You will see the error:
Uncaught TypeError: Cannot read properties of undefined (reading 'htContClient')
To fix this and other similar ones when the grid is hidden:
calcTopBottom: function(left) {
if(typeof(this.dims)==="undefined") return 0;
...
getTop: function(ri, actual) {
var top = this.topArr ? this.topArr[ri] : 0,
...
getLeft: function(_ci, actual) {
if(typeof(this.leftArr)==="undefined") return 0;
...
-
Thanks for sharing the steps to reproduce the error.
-
This is fixed in v10.1.0
Test case:
https://jsfiddle.net/u0n296ym/1/