Open iztisnitibe opened 10 years ago
I think your code has a little problem. I have changed your code to following code, and it worked well.
if (method !== 'init'){ var ol = ms[0].options[(ms[0].options.length)-1]; options.insertAfter(ol); }
If there is any problem, let me know. Thanks
I have a similar problem and I resolved it using an stackoverflow answer but can´t find the question, here is my code:
afterSelect: function(value)
{
$('#select option[value="'+value+'"]').remove();
$('#select').append($("<option></option>").attr("value",value).attr('selected', 'selected'));
var options= $('#select').val().toString();
// DO SOMETHING WITH THE OPTIONS
},
afterDeselect: function(value)
{
$('#select option[value="'+value+'"]').removeAttr('selected');
var options= $('#select ').val().toString();
// DO SOMETHING WITH THE OPTIONS
}
In my particular case I just needed to send a string with the options ordered by the user, but I guess you can send also an array. Good luck & happy coding!
var ol = ms[0].options[(ms[0].options.length)-1]; options.insertAfter(ol);
It solves the issue. but limit selection not working
the order on the underlying SELECT is not kept.
changing this if in the 'select' part solves the problem