Skip to content

Commit e346b9c

Browse files
authored
Merge pull request #2291 from adumesny/master
set an id through setupDragIn
2 parents 6b63244 + e6b3c58 commit e346b9c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

demo/two.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h1>Two grids demo</h1>
6666
let grids = GridStack.initAll(options);
6767
grids[1].float(false);
6868

69-
// new 4.x static method instead of setting up options on every grid (never been per grid really) but old options still works
69+
// new 4.x static method instead of setting up options on every grid (never been per grid really)
7070
GridStack.setupDragIn('.sidebar .grid-stack-item', { appendTo: 'body', helper: myClone });
7171
// GridStack.setupDragIn(); // second call will now work (cache last values)
7272

@@ -85,7 +85,9 @@ <h1>Two grids demo</h1>
8585

8686
// decide what the dropped item will be - for now just a clone but can be anything
8787
function myClone(event) {
88-
return event.target.cloneNode(true);
88+
const el = event.target.cloneNode(true);
89+
el.setAttribute('gs-id', 'foo'); // TEST why clone element is not used directly on drop #2231
90+
return el;
8991
}
9092

9193
function toggleFloat(button, i) {

0 commit comments

Comments
 (0)