Closed
Description
Subject of the issue
I rely deeply on grid stack IDs (gs-id), I need a way to track the widgets
Your environment
- gridstack version: v7.2.3
Steps to reproduce
Here is my helper function:
GridStack.setupDragIn('.gridstack-add-widget', {
appendTo: '.gridstack-widget-dragged',
helper: function (event: Partial<DragEvent>) {
const id = nanoid();
// ...
// some code to store metadata of a widget based on its id
// ...
const target = event.target as GridItemHTMLElement;
const clone = Utils.cloneNode(target.parentElement!);
clone.setAttribute('gs-id', id);
return clone;
},
});
Expected behavior
I expect to set an id with GridStack.setupDragIn
function