You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`static_grid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable. A CSS class `grid-stack-static` is also added to the container.
129
137
-`vertical_margin` - vertical gap size (default: `20`)
130
138
-`width` - amount of columns (default: `12`)
131
139
@@ -152,7 +160,7 @@ to completely lock the widget.
152
160
153
161
### onchange(items)
154
162
155
-
Occurs when widgets change their position/size
163
+
Occurs when adding/removing widgets or existing widgets change their position/size
156
164
157
165
```javascript
158
166
varserialize_widget_map=function (items) {
@@ -249,6 +257,10 @@ Gets current cell width.
249
257
250
258
Finishes batch updates. Updates DOM nodes. You must call it after `batch_update`.
251
259
260
+
### destroy()
261
+
262
+
Destroys a grid instance.
263
+
252
264
### disable()
253
265
254
266
Disables widgets moving/resizing. This is a shortcut for:
@@ -288,6 +300,36 @@ Locks/unlocks widget.
288
300
-`el` - widget to modify.
289
301
-`val` - if `true` widget will be locked.
290
302
303
+
### min_width(el, val)
304
+
305
+
Set the minWidth for a widget.
306
+
307
+
-`el` - widget to modify.
308
+
-`val` - A numeric value of the number of columns
309
+
310
+
### min_height(el, val)
311
+
312
+
Set the minHeight for a widget.
313
+
314
+
-`el` - widget to modify.
315
+
-`val` - A numeric value of the number of rows
316
+
317
+
### movable(el, val)
318
+
319
+
Enables/Disables moving.
320
+
321
+
-`el` - widget to modify
322
+
-`val` - if `true` widget will be draggable.
323
+
324
+
### move(el, x, y)
325
+
326
+
Changes widget position
327
+
328
+
Parameters:
329
+
330
+
-`el` - widget to move
331
+
-`x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
332
+
291
333
### remove_widget(el, detach_node)
292
334
293
335
Removes widget from the grid.
@@ -310,28 +352,18 @@ Parameters:
310
352
-`el` - widget to resize
311
353
-`width`, `height` - new dimensions. If value is `null` or `undefined` it will be ignored.
312
354
313
-
### move(el, x, y)
314
-
315
-
Changes widget position
316
-
317
-
Parameters:
318
-
319
-
-`el` - widget to move
320
-
-`x`, `y` - new position. If value is `null` or `undefined` it will be ignored.
321
-
322
355
### resizable(el, val)
323
356
324
357
Enables/Disables resizing.
325
358
326
359
-`el` - widget to modify
327
360
-`val` - if `true` widget will be resizable.
328
361
329
-
### movable(el, val)
362
+
### set_static(static_value)
330
363
331
-
Enables/Disables moving.
364
+
Toggle the grid static state. Also toggle the `grid-stack-static` class.
332
365
333
-
-`el` - widget to modify
334
-
-`val` - if `true` widget will be draggable.
366
+
-`static_value` - if `true` the grid become static.
335
367
336
368
### update(el, x, y, width, height)
337
369
@@ -519,6 +551,25 @@ Here is a SASS code snipped which can make life easier (Thanks to @ascendantofra
519
551
}
520
552
```
521
553
554
+
Or you can include `gridstack-extra.css`. See below for more details.
555
+
556
+
## Extra CSS
557
+
558
+
There are few extra CSS batteries in `gridstack-extra.css` (`gridstack-extra.min.css`).
559
+
560
+
### Different grid widths
561
+
562
+
You can use other than 12 grid width:
563
+
564
+
```html
565
+
<divclass="grid-stack grid-stack-N">...</div>
566
+
```
567
+
```javascript
568
+
$('.grid-stack').gridstack({width:N});
569
+
```
570
+
571
+
See example: [2 grids demo](http://troolee.github.io/gridstack.js/demo/two.html)
572
+
522
573
## Save grid to array
523
574
524
575
Because gridstack doesn't track any kind of user-defined widget id there is no reason to make serialization to be part
@@ -644,8 +695,16 @@ See example: [Nested grid demo](http://troolee.github.io/gridstack.js/demo/neste
644
695
Changes
645
696
=======
646
697
647
-
#### v0.2.3 (development version)
698
+
#### v0.2.4 (development version)
699
+
700
+
- fix closure compiler/linter warnings
701
+
- add `static_grid` option.
702
+
- add `min_width`/`min_height` methods (Thanks to @cvillemure)
0 commit comments