Closed feus4177 closed 8 years ago
Great idea :+1: I will add it to my to-do list.
How about an ui-sortable-selectionschanged
on the ui-sortable
element itself?
I would prefer it instead of firing several events on the selectable items (for selections and deselections).
That should be enough for my use case. I was thinking in general it might be nice to add information like which elements are selected. It would be nice if the event could be heard even when the element is immediately dragged but again that isn't critical for me. Would jquery-ui-sortable interfere with an angular $emit
event?
Do you prefer emitting jquery events or using angular's $emit? Because, I think that $emit can lead to unnecessary digests.
Normally I try to stay within the confines of angular as much as possible and only use jquery for DOM traversal, but since the core of the functionality is still jquery-ui and all the other events are jquery events I'm fine with continuing to use jquery events. It's just unfortunate that sometimes the ui-sortable-selectionschanged
event will be prevented but it isn't a huge deal.
This is partially fixed in #18 where we trigger the 'ui-sortable-selectionschanged'
event on the ui-sortable
element.
There is currently no extra message passed along with the event. Please try it out and suggest improvements. For example we could trigger the event with the selected model indexes as a message.
How can make use of that event to capture the elements selected? Do you have a code sample?
It would be nice if there were events for un/selecting elements. Currently I have a
$watch
that checks for the'ui-sortable-selected'
class but I would prefer to listen for an event.