Skip to content

Commit 1e747cc

Browse files
author
Alain Dumesny
committed
widget properties when dropping it into other grid
fix for #924 * updated two.html to have some min/max/id contrain to copy over TODO: all data-gs- props are there, but the resize/move feedback isn't in sync. I suspec onEndMoving() not having o.data('_gridstack_node') as the culprit.
1 parent 3798b2a commit 1e747cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

demo/two.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,16 @@ <h1>Two grids demo</h1>
121121
{x: 0, y: 0, width: 2, height: 2},
122122
{x: 3, y: 1, width: 1, height: 2},
123123
{x: 4, y: 1, width: 1, height: 1},
124-
{x: 2, y: 3, width: 3, height: 1},
124+
{x: 2, y: 3, width: 3, height: 1, minWidth: 2, id: 'special', text: 'has minWidth=2'},
125125
{x: 2, y: 5, width: 1, height: 1}
126126
];
127127

128128
$('.grid-stack').each(function () {
129129
var grid = $(this).data('gridstack');
130130

131131
items.forEach(function (node) {
132-
grid.addWidget($('<div><div class="grid-stack-item-content"></div></div>'), node);
132+
grid.addWidget($('<div><div class="grid-stack-item-content">'
133+
+ (node.text? node.text : '') + '</div></div>'), node);
133134
});
134135
});
135136

0 commit comments

Comments
 (0)