I'm using Gridstack. So far everything works fine. Now I'm trying to find a solution to change the size of an item by a click.
I changed the item attributes "gs-w" and "gs-h" by JS on click. This changed the size temporary, but on the next drag&drop the old sizes comes again. And it's also not rearranging the position of the other items around. Could somebody give me a hint, how to do it correctly?
After long trying I found the solution:
In the Update method has to be the class of the item, which you want to change (not the id!). And the "opt" has to be an array with x,y,w,h. Finally with jQuery it looks like:
('#button').click(function(){
GridStack.update('the-class', {x:10,y:10,w:2,h:4});
});
It is as simple as I expected. But how can you know, that it has to be the class and an array...