I have been looking everywhere for hours on how to disable and enable dragging/re-sizing on an active grid. Am I not able to find anything on it because it can not happen? I saw there are functions to do it, but no good examples or even real documentation on how to use them.
https://github.com/troolee/gridstack.js/tree/master/doc#enablemovedoenable-includenewwidgets
and
https://github.com/troolee/gridstack.js/tree/master/doc#enableresizedoenable-includenewwidgets
When you have your gridstack object in the grid variable, call .enableMove with false for doEnable and true for includeNewWidgets.
ie:
var grid = $('.grid-stack').data('gridstack');
grid.enableMove(false, true);
grid.enableResize(false, true);
As you'll note, the entirety of this information is already in the API docs. While we do not have large sets of examples for each individual API call, we have function signatures and explanations for every single public API call.
If you'd like to write some examples, the community would be delighted to include them in the documentation.
Most helpful comment
https://github.com/troolee/gridstack.js/tree/master/doc#enablemovedoenable-includenewwidgets
and
https://github.com/troolee/gridstack.js/tree/master/doc#enableresizedoenable-includenewwidgets
When you have your gridstack object in the
gridvariable, call.enableMovewith false fordoEnableand true forincludeNewWidgets.ie:
As you'll note, the entirety of this information is already in the API docs. While we do not have large sets of examples for each individual API call, we have function signatures and explanations for every single public API call.
If you'd like to write some examples, the community would be delighted to include them in the documentation.