X-SlickGrid icon indicating copy to clipboard operation
X-SlickGrid copied to clipboard

Slickgrid not displaying properly after changing grid options

Open jandsmit opened this issue 9 years ago • 3 comments

After changing grid options with setOptions like this:

subGrid.setOptions({ editable: true });

... the grid does not redraw correctly. All columns are compressed to the left. Resizing a column restores the grid and everything is ok.

I found it to be a bug in slick.grid.js (2.2) in function absBox(elem). The first 'while' loop allows elem to become null and there the grid breaks.

I tested by simply inserting:

if (elem == null) break; - directly after the while and that solves the problem.

jandsmit avatar May 22 '15 17:05 jandsmit

Hi @jandsmit. Could you create a jsFiddle that simulate this issue?

ddomingues avatar Jul 21 '15 11:07 ddomingues

Hi,

If I can find some time, I would. But unfortunately, I don’t have that time… sorry. But the problem is so clear, there is no need for a simulation, in my opinion. Just by looking at the code, you can see that things go wrong because there is no check for a NULL value.

But then again, whenever I find some time, I will create a jsFiddle… but that would be the first time for me there; need to figure out how it works ;)

Jan

Op 21 jul. 2015, om 13:31 heeft Diego Henrique Domingues [email protected] het volgende geschreven:

Hi @jandsmit https://github.com/jandsmit. Could you create a jsFiddle https://jsfiddle.net/ that simulate this issue?

— Reply to this email directly or view it on GitHub https://github.com/ddomingues/X-SlickGrid/issues/2#issuecomment-123273705.

jandsmit avatar Jul 24 '15 14:07 jandsmit

Hi @ddomingues

I created https://github.com/ddomingues/X-SlickGrid/pull/26 with a suggestion to fix this issue. Essentially, it happens when columns are set using setColumns (without passing them in the grid constructor) followed by a call to setOptions.

ronrother avatar Jul 06 '17 17:07 ronrother