$('#documents_type_doc_sel').html('');
$('#documents_type_doc_sel').append('<option value="">(Tous types)</option>');
const _get = new URLSearchParams(location.search);
+ let currSec = '';
$.each(data, function (idx, val) {
+ if (currSec != val.sec_nom) {
+ currSec = val.sec_nom;
+ $('#documents_type_doc_sel').append('<optgroup label="'+currSec+'"></optgroup>');
+ }
let selected = _get.get('documents_type_doc') && _get.get('documents_type_doc') == val.dty_id ? ' selected' : '';
$('#documents_type_doc_sel').append('<option value="'+val.dty_id+'"'+selected+'>'+val.dty_nom+'</option');
});
<h3>Au </h3>
<input name="documents_date_fin" type="text" size="10" class="datepicker" value="<?php echo $document_fin; ?>" />
</div>
- <br>
<div class="choix_vue">
<h2>Type de document</h2>
- <h3>Thématique</h3>
<select name="documents_thematique" id="documents_thematique_sel">
<option value="">(Toutes thématiques)</option>
<?php
?>
</select>
<br>
- <h3>Type</h3>
<select name="documents_type_doc" id="documents_type_doc_sel"></select>
</div>
<div class="choix_vue maj">