Попробуйте проверить все, кроме:
var deselectOptions = [1, 2, 3];
$('#my_select').multiselect('checkAll');
$('#my_select :selected').each(function () {
if (deselectOptions.includes(parseInt($(this).val()))) {
$(this).prop('selected', false);
}
});
$('#my_select').multiselect('refresh');
или наоборот:
var selectOptions = [1, 2, 3];
//may not be required depending on use case
$('#my_select').multiselect('uncheckAll');
$('#my_select option').each(function () {
if (selectOptions.includes(parseInt($(this).val()))) {
$(this).prop('selected', true);
}
});
$('#my_select').multiselect('refresh');