diff --git a/demo/float.html b/demo/float.html index 988bdd5da..36127464e 100644 --- a/demo/float.html +++ b/demo/float.html @@ -54,6 +54,12 @@

Float grid demo

document.querySelector('#float').innerHTML = 'float: ' + grid.getFloat(); }; addNewWidget(); + addNewWidget(); + + grid.enable(); + grid.save(false, true); // causes error at the end + grid.disable(); + grid.enable(); diff --git a/demo/nested.html b/demo/nested.html index a11a243ab..4ce44881f 100644 --- a/demo/nested.html +++ b/demo/nested.html @@ -21,13 +21,19 @@

Nested grids demo

This example uses new v3.1 API to load the entire nested grid from JSON, and shows dragging between nested grid items (pink) vs dragging higher grid items (green)

-

Note: initial v3 HTML5 release doesn't support 'dragOut:false' constrain so use jq version if you need that.

+

Note: HTML5 release doesn't yet support 'dragOut:false' constrain so use JQ version if you need that.

Add Widget Add Widget Grid1 Add Widget Grid2 + entire save/re-create: Save - Clear - Load + Destroy + Create + partial save/load: + Save list + Save no content + Clear + Load

@@ -45,7 +51,7 @@

Nested grids demo

minWidth: 300, // min to go 1 column mode margin: 1 }; - let json = {cellHeight: 70, children: [ + let json = {cellHeight: 70, minRow: 2, children: [ {y:0, content: 'regular item'}, {x:1, w:4, h:4, content: 'nested 1 - can drag items out', subGrid: {children: sub1, dragOut: true, class: 'nested1', ...subOptions}}, {x:5, w:4, h:4, content: 'nested 2 - constrained to parent (default)', subGrid: {children: sub2, class: 'nested2', ...subOptions}}, @@ -71,17 +77,25 @@

Nested grids demo

return false; }; - save = function() { - json = grid.save(false, true); + save = function(content = true, full = true) { + json = grid.save(content, full); console.log(json); // console.log(JSON.stringify(json)); } - destroy = function() { - grid.destroy(); - grid = undefined; + destroy = function(full = true) { + if (full) { + grid.destroy(); + grid = undefined; + } else { + grid.removeAll(); + } } - load = function() { - grid = GridStack.addGrid(document.querySelector('.container-fluid'), json); + load = function(full = true) { + if (full) { + grid = GridStack.addGrid(document.querySelector('.container-fluid'), json); + } else { + grid.load(json); + } } diff --git a/demo/serialization.html b/demo/serialization.html index b97141626..32ed5be0f 100644 --- a/demo/serialization.html +++ b/demo/serialization.html @@ -24,7 +24,7 @@

Serialization demo