Team 2 (Purview Doctor Tagging) Fetch Selected Doctors
Specific Folder FTP Upload / ftp-deploy (push) Successful in 39s Details

This commit is contained in:
zeeshan 2026-10-08 16:18:44 +05:30
parent e8bebdc6ac
commit 805f357c80
1 changed files with 11 additions and 0 deletions

View File

@ -335,6 +335,8 @@
$("select[id^='field-contact_id']").each(function() {
var select = $(this);
// Clear previous options
var existingValue = select.val();
select.html('');
// Add a default 'Select' option
select.append(
@ -347,6 +349,11 @@
var option = $("<option></option>")
.attr("value", itm.value)
.text(itm.display);
if (existingValue && String(existingValue) === String(itm.value)) {
option.prop('selected', true);
}
// If doctor options have extra attributes
if (itm.contact && itm.contact.msl_code) {
option.attr("msl_code", itm.contact.msl_code);
@ -386,6 +393,10 @@
enforceUniqueDoctorSelections();
});
if (existingValue) {
select.trigger('change');
}
// Ensure unique selection is enforced after initial render
enforceUniqueDoctorSelections();
});