Skip to content

Selected Options cannot be sorted on creation #11

Open
@wmerrell

Description

@wmerrell

I am trying to use your multiselect widget to select and sort some data on my Rails site. It seems to work and do what I want except that the selected items always appear in the same order. That is, I can use the widget to select and rearrange the items, and when I submit the form I get the selected items in the sorted order. However, if I revisit the page the same items are selected, but they are in the order of the available items list, not the order I selected on the previous visit. I have not found any way to change this. I did look at the sortMethod option, but it does not work properly. Even when I altered the code so the custom sort function was called properly, it did not change the order of the items. I think that this is because the sort function is being applied to the entire available items list and not just the selected items list. Any help would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions