function charger_valeurs_point(implantation_id) {
var params = {'implantation_id' : implantation_id};
var chargement_vp = $.getJSON('/dae/liste_valeurs_point', params);
+ var selected_min = $('#id_valeur_point_min').val()
+ var selected_max = $('#id_valeur_point_max').val()
chargement_vp.success(function(data) {
var items = [];
var suggestion = "";
if (this.suggestion) {
suggestion = ' style="font-weight: bold; color: black;" '
+ selected_min = selected_min || this.id;
+ selected_max = selected_max || this.id;
}
options += '<option' + suggestion + ' value="' + this.id + '">' + this.label + '</option>';
});
- $("#id_valeur_point_min").html(options);
- $("#id_valeur_point_max").html(options);
- alert("Les valeurs de point et les postes ont été ajustés en fonction de cette implantation.");
+ $('#id_valeur_point_min').html(options).val(selected_min);
+ $('#id_valeur_point_max').html(options).val(selected_max);
});
}