You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.
I am exploring dragular with following option
copy: true,
copySortSource: true
Events registered on original elements are not getting copied with these option.Please what approach can be used so that along with dom and scope, events also should get copied in this mode.
There are two issues
Cloned element across containers does not have registered event of original element.
Within same container element loose registered events
Cloning events is not so simple, there is no API for it in DOM. I dont want to wrap build-in methods mentioned here. So your option here is to register the events again on drop event, edited plunker here. Thanks for using dragular ;)
Aaa.. I have found better solution.. I can clone the element via jQlite which is part of angularjs core and it fully implements jQuery clone which has ability to clone event handlers too.. so I will add this feature in next release.. I will let you know here.
Yeah.. but it is a bit more complicated as I thought. jQLite does not attach the listeners to the cloned element, as I thought.. so I will look at this later. :/
I have support for JQuery in my project so I will use its clone method only issue with that is probably after registering new handler scope data would be still pointing towards original element as I wont be able to create fresh scope for cloned element with new values on droped event unless I use $compile service to create new element on fly and instead of attaching dragular cloned element use compiled element so visually it would appear as drag drop operation with source element intact.
I am exploring dragular with following option
copy: true,
copySortSource: true
Events registered on original elements are not getting copied with these option.Please what approach can be used so that along with dom and scope, events also should get copied in this mode.
There are two issues
Please refer plunker created by me for these problems
https://plnkr.co/edit/geahyNnuZxFsuMLzFVER?p=preview
Regards,
San
The text was updated successfully, but these errors were encountered: