Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 96145038

Von Bernd Bleßmann vor etwa 22 Stunden hinzugefügt

  • ID 96145038a7ff693efd5fd07c0f058caa76922105
  • Vorgänger a833c262

Presenter Lagerplatz: Beim Laden vorbelegte Auswahl berücksichtigen

Unterschiede anzeigen:

js/kivi.Warehouse.js
3 3
  ns.wh_changed = function(target) {
4 4
    const wh_id        = $(target).val();
5 5
    const bin_dom_id   = $(target).data('bin-dom-id');
6
    const bin_id       = $('#' + bin_dom_id).val();
7

  
6 8
    $.post("controller.pl", { action:       'Warehouse/wh_bin_select_update_bins',
7 9
                              wh_id:        wh_id,
10
                              bin_id:       bin_id,
8 11
                              bin_dom_id:   bin_dom_id },
9 12
           kivi.eval_json_result);
10 13
  };
11 14

  
12
  ns.wh_bin_select_update_bins = function(bin_dom_id, bins) {
15
  ns.wh_bin_select_update_bins = function(bin_dom_id, bins, selected_bin) {
13 16
    const $bin_select = $('#' + bin_dom_id);
14 17
    $bin_select.empty();
18

  
15 19
    $.each(bins, function(idx, elt) {
16
      $bin_select.append($('<option/>', {value: elt.key, text: elt.value}));
20
      if (elt.key == selected_bin) {
21
        $bin_select.append($('<option/>', {value: elt.key, text: elt.value, selected: 1}));
22
      } else {
23
        $bin_select.append($('<option/>', {value: elt.key, text: elt.value}));
24
      }
17 25
    });
18 26
  };
19 27

  

Auch abrufbar als: Unified diff