ember-cli-selectize icon indicating copy to clipboard operation
ember-cli-selectize copied to clipboard

using drag and drop plugin doesn't update selection order

Open mszoernyi opened this issue 9 years ago • 4 comments

Did I miss some configurations or is this a bug or intended to work like this?

If you use ember-selectize with the drag_drop plugin enabled and change the order of selection it won't update the selection property accordingly.

mszoernyi avatar Jul 23 '15 15:07 mszoernyi

You mean it won't change the order in the selection array?

It's neither a bug or a question of configuration, it's just something that isn't implemented. It could be useful.

miguelcobain avatar Jul 24 '15 09:07 miguelcobain

Can you point me to the part which needs to be changed? Couldn't find a proper place to handle it.

Is it best to subscribe to the selectize change event and update the selection accordingly? I could try to prepare a PR

mszoernyi avatar Jul 24 '15 10:07 mszoernyi

@mszoernyi Looking through selectize docs. It looks like we need to include jQuery UI for that.

Probably you could have a better luck extending selectize in our own app, and handle events accordingly. Like:

// my-app/components/ember-selectize.js
import EmberSelectizeComponent from 'ember-cli-selectize/components/ember-selectize';

export default EmberSelectizeComponent.extend({
  // body
});

Now, whenever you do

{{ember-selectize}}

It's your overriden component that will be used instead. In principle one would try to catch whatever selectize event a drag n drop triggers and change the selection array accordingly.

miguelcobain avatar Jul 24 '15 10:07 miguelcobain

Thanks @miguelcobain, I will extend the component first and maybe I figure our how to add this.

mszoernyi avatar Jul 24 '15 14:07 mszoernyi