How to Reconfigure Gridlayout

Hi, I would like to reconfigure a gridlayout (change the number of columns and rows). Is there a method to do so? I have tried using .reconstruct() which fails due to an attribute error. I have also tried replacing the grid, but that removes all of the previous children. I only want to reconfigure the number of columns and rows, please.

Hey @tmose1106, indeed reconstruct does not seem to be working with gridlayout, although i need to confirm it. Either way, for this sort of dynamic modification, you should use a combo of define to redefine the default config and refresh()/resize() depending on the view to render our view with the updated config. In our case that will be resize(): https://snippet.webix.com/h4kkfz67.

This solution works perfectly. I knew about these methods previously, but I guess I did not try them together.

Thank you so much! This was a real lifesaver.

No problems. And you should always follow up the define with either one of the refresh/resize/reconstruct methods depending on the view, you can read more about it here if you’re interested - https://docs.webix.com/desktop__redefinition.html#applyingpropertychanges. Also I’ve confirmed the issue with the reconstruct() for the gridlayout, this seems to be a bug rather than a documentation error, we are looking into fixing it at the moment.