Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3816fa5 commit 3eaa17dCopy full SHA for 3eaa17d
README.md
@@ -364,6 +364,31 @@ For 4-column grid it should be:
364
365
and so on.
366
367
+## Load grid from array
368
+
369
+```javascript
370
+var serialization = [
371
+ {x: 0, y: 0, width: 2, height: 2},
372
+ {x: 3, y: 1, width: 1, height: 2},
373
+ {x: 4, y: 1, width: 1, height: 1},
374
+ {x: 2, y: 3, width: 3, height: 1},
375
+ {x: 1, y: 4, width: 1, height: 1},
376
+ {x: 1, y: 3, width: 1, height: 1},
377
+ {x: 2, y: 4, width: 1, height: 1},
378
+ {x: 2, y: 5, width: 1, height: 1}
379
+];
380
381
+serialization = GridStackUI.Utils.sort(serialization);
382
383
+var grid = $('.grid-stack').data('gridstack');
384
+grid.remove_all();
385
386
+_.each(serialization, function (node) {
387
+ grid.add_widget($('<div><div class="grid-stack-item-content" /><div/>'),
388
+ node.x, node.y, node.width, node.height);
389
+});
390
+```
391
392
393
Changes
394
=======
0 commit comments