Team 2 (Purview Doctor Tagging ) Edit issue fix
Specific Folder FTP Upload / ftp-deploy (push) Successful in 42s Details

This commit is contained in:
zeeshan 2026-10-08 16:32:39 +05:30
parent 805f357c80
commit 465574c73d
1 changed files with 14 additions and 7 deletions

View File

@ -129,7 +129,7 @@
$options = collect($question->options)->sortBy('display', SORT_NATURAL | SORT_FLAG_CASE); $options = collect($question->options)->sortBy('display', SORT_NATURAL | SORT_FLAG_CASE);
@endphp @endphp
<select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}> <select class="form-control" {!!($isContact)?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" data-selected="{{ isset($question->value) ? $question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
<option value=""> -- Select -- </option> <option value=""> -- Select -- </option>
{{-- $question->options ऐवजी $options वापरा --}} {{-- $question->options ऐवजी $options वापरा --}}
@ -336,8 +336,9 @@
var select = $(this); var select = $(this);
// Clear previous options // Clear previous options
var existingValue = select.val(); var savedValue = select.attr('data-selected') || select.data('selected') || select.val() || '';
select.html(''); select.empty();
// Add a default 'Select' option // Add a default 'Select' option
select.append( select.append(
$("<option></option>") $("<option></option>")
@ -361,6 +362,11 @@
if (itm.contact && itm.contact.speciality) { if (itm.contact && itm.contact.speciality) {
option.attr("speciality", itm.contact.speciality); option.attr("speciality", itm.contact.speciality);
} }
if (savedValue && String(savedValue) === String(itm.value)) {
option.prop('selected', true);
}
select.append(option); select.append(option);
}); });
@ -393,14 +399,15 @@
enforceUniqueDoctorSelections(); enforceUniqueDoctorSelections();
}); });
if (existingValue) { if (savedValue) {
select.trigger('change'); select.val(savedValue).trigger('change');
} }
});
// Ensure unique selection is enforced after initial render // Ensure unique selection is enforced after initial render
enforceUniqueDoctorSelections(); enforceUniqueDoctorSelections();
});
// Enable search on doctor dropdowns // Enable search on doctor dropdowns
applySelect2ToDoctorDropdowns(); applySelect2ToDoctorDropdowns();
$("#pageloader").fadeOut(); $("#pageloader").fadeOut();