Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-ordering does not send multiselectChange #77

Open
fnxweb opened this issue Oct 24, 2013 · 1 comment
Open

Re-ordering does not send multiselectChange #77

fnxweb opened this issue Oct 24, 2013 · 1 comment

Comments

@fnxweb
Copy link

fnxweb commented Oct 24, 2013

I am using the widget with “sortable” enabled to update a link elsewhere as changes are made to the selection (it's not being used an a form that will be submitted).

While I am getting the multiselectChange event for additions and removals OK, I don't get it when the list is re-ordered (and the order is important to me).

While it could probably be factored more cleanly, & it might have unforeseen [by me] side-effects, I got what I wanted by editing _createGroupContainerElement (~ line 827):

 /* FNX - send update when items dragged */
 /* if (e) that._reorderSelected(e.optionGroup); */
 if (e) {
   that._reorderSelected(e.optionGroup);
   if (!_received_index)  /* already done if _received_index */
     that._widget._triggerUIEvent(EVENT_CHANGE, { optionElements:[e.optionElement[0]], selected:true } );
 }
 /* /FNX */
@ksiegel
Copy link
Contributor

ksiegel commented Feb 12, 2014

I was about to post a similar issue but I'll just pop into this one instead. I was going to suggest a separate event for reorder. In my implementation, I tapped into the jQueryUI events for sortable so I could run a different function on reorder than on change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants