multi-select
multi-select copied to clipboard
keep order not working with events afterSelect and afterDeselect
I have this code and keepOrder not works with events. I removed the refresh method at the end of events.
$('#dimension_types_ids').multiSelect({
keepOrder: true,
afterSelect: function (value) {
a_dimension_types_ids.push(Number(value));
if (a_dimension_types_ids.length > 1) {
$('#dimension_types_ids option').not(':selected').prop('disabled', true);
} else {
$('#dimension_types_ids option').not(':selected').prop('disabled', false);
}
},
afterDeselect: function (value) {
let index = a_dimension_types_ids.indexOf(Number(value));
if (index > -1) {
a_dimension_types_ids.splice(index, 1);
}
if (a_dimension_types_ids.length > 1) {
$('#dimension_types_ids option').not(':selected').prop('disabled', true);
} else {
$('#dimension_types_ids option').not(':selected').prop('disabled', false);
}
},
});
Same problem here. Did you find a solution?
No. I give up from this component. I did not have time to check multi-select code for my project. And I think this project is kinda like abandoned. So I am using select2 now.