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

Resize for a single widget with min/max-resize not possible? #392

Open Daijobou opened 10 years ago

Daijobou commented 10 years ago

Hello.

I want add ~20 widgets, but only few of them with a resize property and each of them with individual min/max for resize. Is this not possible?

I have tried:

gridster.add_widget('<li />', 2, 1, 1, 1)
    .resizable({
    resize: {
            enabled: true,
            max_size: [2, 2]
    }
});

Another:

var widget = gridster.add_widget('<li />', 1, 1, 1, 1);
widget.attr('data-min-sizex', 2);
widget.attr('data-min-sizey', 2);

Can anybody help me? ;)

EDIT:

Here its working for pre-defined widgets: http://gridster.net/demos/resize-limits.html I need it for runtime. ;)

j-konopka commented 9 years ago

At the moment you can set "data-max-sizex" and "data-max-sizey" equals to "data-min-sizex" and "data-min-sizey" for the widgets you don't want to resize.