-
Notifications
You must be signed in to change notification settings - Fork 62
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
loading selected item in order as it was saved #101
Comments
I have this problem too, and I found “sortMethod” option can not work. Then I write a resort function which invoked after this multiselect plugin init, it still not work. Like this : |
Might be a bit late but this was giving me a headache also. $(this).multiselect( { sortable : true , availableListPosition : "left" , splitRatio: 0.5 , sortMethod: null}); make sure the sort method is null and will work fine. Will take the order you have in the <select . You just need to put the selected options in order you saved. Cheers |
Hi But its steel sorting in the way that was. Anyone found solution for this? |
I just found this widget and it's exactly what I need. I use it to allow the user to select items to display in a table, and drag and drop works great to allow them to also define the order of the selected items. The problem I have is that, when I reload the widget with values stored in the database, the selected items revert to alphabetical order, rather than the order in which I mark them as selected. That is, I load the widget initially with all of the possible selections, then, when the page is finished loading, I walk through a separate array of stored selected items and add the selected attribute to them. It works - they do, in fact, appear correctly in the selected options list, but not in the order I have added the selected attribute. Here's the relevant code to define the widget:
And here is how I initialize the selected items:
The widget display them alphabetically in the selected items section. What am I doing wrong? Thanks! |
Hi guys, I found out a way to load saved results in the right order. Example: // this order is not important: // this order is the one that will be shown: |
This is the prefect widget for me, easy to select and sort. but if it allow user to drag and drop, and dont make sense when load back from database not in order. Please tell me how to do so. Thank you so much for your hard working.
The text was updated successfully, but these errors were encountered: