how disabled a option via programatically?

27 views
Skip to first unread message

fabio...@gmail.com

unread,
Mar 25, 2017, 9:22:27 PM3/25/17
to select2
im interesting to know, how make than one a1.select2() disable a option on a2.select2(), programatically, but the select didnt change, for example

$('.select-dispatch-locker').on('change',function(){
$("#locker-dispatch-selected option").filter(function() {
if($(this).prop('selected')){
var id = $(this).val();
$('.select-dispatch-locker').on('change',function(){
$("#locker-arrived-selected option").filter(function() {
if($(this).val() == id){
$(this).prop('disabled',true).trigger("change");
}
});
})
}
});
});

sorin.po...@gmail.com

unread,
May 10, 2017, 3:19:54 PM5/10/17
to select2, fabio...@gmail.com
Could you please provide some examples contents for the three HTML select elements?
(select-dispatch-locker, locker-dispatch-selected, locker-arrived-selected)

Or even better, please provide a jsfiddle.

Reply all
Reply to author
Forward
0 new messages