Author Topic: Another v10.0.0 bug with fix  (Read 233 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Another v10.0.0 bug with fix
« 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,

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #1 on: October 21, 2024, 10:08:27 pm »
Please share a jsfiddle.

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #2 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #3 on: October 21, 2024, 11:12:29 pm »

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #4 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/

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/)

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)
« Last Edit: October 21, 2024, 11:49:08 pm by jplevene »

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 131
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #5 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;
...

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #6 on: October 30, 2024, 01:08:30 pm »
Thanks for sharing the steps to reproduce the error.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Another v10.0.0 bug with fix
« Reply #7 on: November 20, 2024, 12:00:50 pm »
This is fixed in v10.1.0

Test case:

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