bselect icon indicating copy to clipboard operation
bselect copied to clipboard

Update select after insert new options

Open map1975 opened this issue 7 years ago • 0 comments

Hi, Is there a way to update the select after dynamically inserting new options?

//  I create a new option and insert it in the select
jQuery("#jform_user_id").append(jQuery("<option>").text(data.user.name+' '+data.user.surname).attr("value", data.user.id));

//  Set the option as selected
jQuery("#jform_user_id").val(data.user.id);

//  Now I should update the select with the new option, how can I do?

jQuery("#jform_user_id").bselect("updateOptions") ???

Thank you

map1975 avatar Feb 22 '18 17:02 map1975