multiple select can support keep user select order, instead of options order
example:
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
user selection sequence is 2, 3, 1。
we want get the val() is ["2", "3", "1"], not ["1", "2", "3"]
why is this archived? wouldn't this be a nice feature? did i miss it?
I recommend using the changed.bs.select event to check the order the options are selected in.
Using changed.bs.select is really inconvenient. I agree with MithrilMan. If there's no way to get the ordered list of items, there should be at least a separated event for adding and removing elements, so we can build our own list.
Think of the real use case scenario:
I have a selection of animals, and currently have selected:
var mySelection = ["cat", "dog", "horse", "whale"]
Then I receive changed.bs.select, and I access the .val(), obtaining:
["cat", "dog", "giraffe", "horse", "whale"]
I have no way of knowing if this is an insertion or a removal except for iterating through all the list of items in both arrays and comparing element to element. That seems quite an overkill to me, that could simple be solved by having separated insert/remove events or -probably better- an ordered selection val().
Just my 2 cents.
Most helpful comment
why is this archived? wouldn't this be a nice feature? did i miss it?