X-SlickGrid
X-SlickGrid copied to clipboard
Slickgrid not displaying properly after changing grid options
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.
Hi @jandsmit. Could you create a jsFiddle that simulate this issue?
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.
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.