1

Im trying to look up to see if UISelect(multiple) provides a feature to drag move items within the control to sort the list ?

I tried googling for the same and couldn't find much information on this.

Appreciate if you can provide link to some kind of documentation so that i can start from there.

NOTE : I fairly understand how UISelect works.

Sunil Vurity
  • 830
  • 9
  • 14

2 Answers2

2

Just for reference: There has been added a sortable="true" option in v0.10. However this feature is not yet properly documented, but for further information, see this github issue or demo-multi-select.html in the examples folder.

madc
  • 1,674
  • 2
  • 26
  • 41
  • 1
    @Sunil Vurity would you mind accepting this answer so that future searchers can find it more easily? – Zane Jun 11 '16 at 15:11
0

It uses the ui-select-match directive as the "template" inside an ng-repeat that generates them. Unfortunately that ng-repeat, unlike ui-select-choices's repeat parameter is hardcoded inside ui-select's directive templates.

Look at this template: https://github.com/angular-ui/ui-select/blob/master/src/select2/match-multiple.tpl.html

In the build version of ui-select it's inlined using $templateCache, thus you can easily replace it with your own version and apply sorting on that ng-repeat="$item in $select.selected".

You could also integrate something like ngDraggable there. The main issue here would be CSS though and absolute positioning used.

Community
  • 1
  • 1
Sergiu Paraschiv
  • 9,929
  • 5
  • 36
  • 47