When the data goes to the ListBox, it wanted to be selected immediately: I do not know why it did not work.
itensListBoxCatequizandos.append('<option value="' + obj.val + '"> ' + obj.name + '</option>').prop('selected', true);
When the data goes to the ListBox, it wanted to be selected immediately: I do not know why it did not work.
itensListBoxCatequizandos.append('<option value="' + obj.val + '"> ' + obj.name + '</option>').prop('selected', true);
Okay. I solved the problem:
$.each(myCheckboxes, function (i, obj) {
itensListBoxCatequizandos.append('<option value="' + obj.val + '"> ' + obj.name + '</option>');
$("select option[value=" + obj.val + "]").attr("selected", true);
});