diff --git a/demo/column.html b/demo/column.html
index 8de31e93b..40c6f5c2f 100644
--- a/demo/column.html
+++ b/demo/column.html
@@ -22,6 +22,7 @@
Add Widget
1 Column
+
1 Column DOM
2 Column
3 Column
4 Column
@@ -54,15 +55,15 @@
setColumn() grid demo
var items = [
{x: 0, y: 0, width: 2, height: 2},
{x: 2, y: 0, width: 2, height: 1},
- {x: 5, y: 0, width: 1, height: 1},
+ {x: 5, y: 1, width: 1, height: 1},
+ {x: 5, y: 0, width: 2, height: 1},
{text: ' auto'}, // autoPosition testing
- {x: 1, y: 3, width: 4, height: 1},
{x: 5, y: 3, width: 2, height: 1},
{x: 0, y: 4, width: 12, height: 1}
];
var count = 0;
grid.batchUpdate();
- for (count=0; count<3;) {
+ for (count=0; count<4;) {
var n = items[count];
grid.addWidget($('
' + count++ + (n.text ? n.text : '') + '
'), n);
};
@@ -78,7 +79,8 @@
setColumn() grid demo
grid.addWidget($('
' + count++ + (n.text ? n.text : '') + '
'), n);
});
- $('#1column').click(function() { grid.setColumn(1); $text.text(1);});
+ $('#1column').click(function() { delete grid.opts.oneColumnModeDomSort; grid.setColumn(1); $text.text(1);});
+ $('#1columnDOM').click(function() { grid.opts.oneColumnModeDomSort = true; grid.setColumn(1); $text.text('1 DOM');});
$('#2column').click(function() { grid.setColumn(2); $text.text(2);});
$('#3column').click(function() { grid.setColumn(3); $text.text(3);});
$('#4column').click(function() { grid.setColumn(4); $text.text(4);});
diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index 6c2a9c819..0d27e40f4 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -29,6 +29,7 @@ Change log
## v0.6.1-dev (upcoming changes)
+- add `oneColumnModeDomSort` true|false to let you specify a custom layout (use dom order instead of x,y) for oneColumnMode `setColumn(1)` [#713](https://github.com/gridstack/gridstack.js/issues/713)
- fix oneColumnMode to only restore if we auto went to it as window sizes up [#1125](https://github.com/gridstack/gridstack.js/pull/1125)
## v0.6.1 (2020-02-02)
diff --git a/spec/gridstack-spec.js b/spec/gridstack-spec.js
index 0b650c3b1..19170776f 100644
--- a/spec/gridstack-spec.js
+++ b/spec/gridstack-spec.js
@@ -15,6 +15,12 @@ describe('gridstack', function() {
'
' +
' ' +
'';
+ // empty grid
+ var gridstackEmptyHTML =
+ '