ParamQuery grid support forum

General Category => Bug Report => Topic started by: jplevene on October 21, 2024, 08:12:06 pm

Title: Another v10.0.0 bug with fix
Post 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

Code: [Select]
var top = this.topArr[ri],
Changing it to below fixes it:

Code: [Select]
var top = this.topArr ? this.topArr[ri] : 0,
Title: Re: Another v10.0.0 bug with fix
Post by: paramvir on October 21, 2024, 10:08:27 pm
Please share a jsfiddle.
Title: Re: Another v10.0.0 bug with fix
Post by: jplevene on October 21, 2024, 10:49:01 pm
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
Title: Re: Another v10.0.0 bug with fix
Post by: paramvir on October 21, 2024, 11:12:29 pm
It works fine: https://jsfiddle.net/jLd1eh26/
Title: Re: Another v10.0.0 bug with fix
Post by: jplevene on October 21, 2024, 11:34:05 pm
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)
Title: Re: Another v10.0.0 bug with fix
Post by: jplevene on October 29, 2024, 06:06:54 am
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:


Code: [Select]
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;
...
Title: Re: Another v10.0.0 bug with fix
Post by: paramvir on October 30, 2024, 01:08:30 pm
Thanks for sharing the steps to reproduce the error.
Title: Re: Another v10.0.0 bug with fix
Post by: paramvir on November 20, 2024, 12:00:50 pm
This is fixed in v10.1.0

Test case:

https://jsfiddle.net/u0n296ym/1/