-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quickish question: How do you update the number of columns the grid is using dynamically? #227
Comments
Try this : It's a little hack (because it doesn't use a public method...) And don't forget to change css class in the grid to grid-stack-2 |
We can expose a method to modify this on the fly, but as @Booster78 says, you'll also need to change the CSS. |
…gently change existing widgets' x-coordinate and width to map to new width.
Using gridstack v.0.2.5 you may now use the grid's |
Example usage should be: |
setGridWidth seems to be working now, it had to be different problem causing items to overlap 🤔 |
When you create a new grid I know that you can define the number of columns by setting the 'width' in the options array.
For example:
$('.grid-stack').gridstack( {width: 3} );
Is there a way, through jQuery, to update this value to 2 for example.
I have tried:
$('.grid-stack').gridstack({ width: 2 });
$('.grid-stack').data('gridstack').width = 2;
Any ideas? Thanks
The text was updated successfully, but these errors were encountered: