I am using the basic Drag and Drop example of Sencha and modifying it. I need to have a button that is able to create a new div and make it draggable. I have been able to do the first thing, but then I can’t make it draggable.
I know if I do the following I make the div draggable:
new Ext.util.Draggable('my-div-id', { });
but when I click the button for a second time, it does’t work anymore. It seems that I can only create one draggable div with the same id.
How can I solve this?
This is what I did:
Inside my function to create a div:
So with the variable
countI create a new id for every div I generate, thus making them all draggable.