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
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,16 +92,16 @@ creating items dynamically...
92
92
93
93
// ...in your script
94
94
var grid =GridStack.init();
95
-
grid.addWidget({width:2, content:'item 1'});
95
+
grid.addWidget({w:2, content:'item 1'});
96
96
```
97
97
98
98
... or creating from list
99
99
100
100
```js
101
101
// using serialize data instead of .addWidget()
102
102
constserializedData= [
103
-
{x:0, y:0, width:2, height:2},
104
-
{x:2, y:3, width:3, content:'item 2'},
103
+
{x:0, y:0, w:2, h:2},
104
+
{x:2, y:3, w:3, content:'item 2'},
105
105
{x:1, y:3}
106
106
];
107
107
@@ -315,7 +315,7 @@ var grid = $('.grid-stack').data('gridstack');
315
315
var grid =GridStack.init(opts?, element?);
316
316
317
317
// returns DOM element
318
-
grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {width:2});
318
+
grid.addWidget('<div><div class="grid-stack-item-content"> test </div></div>', {w:2});
319
319
320
320
// event handler
321
321
grid.on('added', function(e, items) {/* items contains info */});
@@ -362,7 +362,7 @@ v2 is a Typescript rewrite of 1.x, removing all jquery events, using classes and
362
362
363
363
make sure to read v2 migration first!
364
364
365
-
v3 has a new HTML5 drag&drop plugging (65k total, all native code), while still allowing you to use the legacy jquery-ui version (188k), or a new static grid version (35k, no user drag&drop but full API support). You will need to decide which version to use as `gridstack.all.js` no longer exist (same as `gridstack-jq.js`) - see include info at top.
365
+
v3 has a new HTML5 drag&drop plugging (63k total, all native code), while still allowing you to use the legacy jquery-ui version (186k), or a new static grid version (34k, no user drag&drop but full API support). You will need to decide which version to use as `gridstack.all.js` no longer exist (same as `gridstack-jq.js`) - see include info at top.
366
366
367
367
Some breaking changes:
368
368
@@ -372,6 +372,8 @@ Some breaking changes:
372
372
373
373
3. item attribute like `data-gs-min-width` is now `gs-min-w`. We removed 'data-' from all attributes, and shorten 'width|height' to just 'w|h' to require typing and more efficient.
374
374
375
+
4. `GridStackWidget` used in most API `width|height|minWidth|minHeight|maxWidth|maxHeight` are now shorter `w|h|minW|minH|maxW|maxH` as well
376
+
375
377
# jQuery Application
376
378
377
379
We now have a native HTML5 drag'n'drop through the plugin system (default), but the jquery-ui version can be used instead. It will bundle `jquery` (3.5.1) + `jquery-ui` (1.12.1 minimal drag|drop|resize) in `gridstack-jq.js`. IFF your app needs to bring your own version instead, you should **instead** include `gridstack-poly.min.js` (optional IE support) + `gridstack.min.js` + `gridstack.jQueryUI.min.js` after you import your JQ libs. But note that there are issue with jQuery and ES6 import (see [1306](https://github.com/gridstack/gridstack.js/issues/1306)).
0 commit comments