ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

cannot enabled resize #558

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi, I'm using gridster with polymer.

When trying to enabled resize (with this.gridster.enabled_resize() ) an error occured

Uncaught TypeError: Cannot read property 'enable' of undefined

It seems that resize_api is not defined

ghost commented 8 years ago

It seems that, when creating the gridster element, the resize.enabled should be define at true

kafoso commented 8 years ago

I can confirm this.

resize: {
    enabled: false,
},

... fails when using grid.enable_resize() and grid.disable_resize().

resize: {
    enabled: true,
},

... will work.

Currently, to work around it, simply do:

var grid = $("#container").gridster({
    resize: {
        enabled: true,
    },
});
grid.disable_resize();