Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4af0680d

Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt

  • ID 4af0680de7454195d92003613a03dc3eca4d94d2
  • Vorgänger ed199252
  • Nachfolger 8ad661b7

PartPicker: Mehrfachauswahl: Option um Positions-Eingabefed anzuzeigen

Die Eingabe kann im Callback verwendet werden, um die Artikel an bestimmte
Positionen zu setzen.

Unterschiede anzeigen:

SL/Presenter/Part.pm
256 256
Or you can even do it the other way round setting C<multiple> to 1 on creation
257 257
and open a single selection popup with js.
258 258

  
259
If C<%params> contains C<multiple_pos_input> an input field with the dom id
260
C<multi_items_position> will be rendered in the alternative popup.
261
This can be used in the callback for C<set_multi_items> to controll the
262
input postion for the items.
263

  
259 264
If C<%params> contains C<multiple_limit> the alternative popup will not
260 265
show any results if there are more than C<multiple_limit> results. A warning
261 266
message is displayed in this case. Set C<multiple_limit> to 0 to disable
js/kivi.Part.js
668 668
        url: 'controller.pl?action=Part/show_multi_items_dialog',
669 669
        data: $.extend({
670 670
          real_id: self.pp.real_id,
671
          show_pos_input: self.pp.o.multiple_pos_input,
671 672
        }, self.pp.ajax_data(this.pp.$dummy.val())),
672 673
        id: 'jq_multi_items_dialog',
673 674
        dialog: {
......
736 737
      $('#jq_multi_items_dialog').dialog('close');
737 738
    },
738 739
    disable_continue: function() {
739
      $('#multi_items_result input').off("keydown");
740
      $('#multi_items_result input, #multi_items_position').off("keydown");
740 741
      $('#continue_button').prop('disabled', true);
741 742
    },
742 743
    enable_continue: function() {
743 744
      var self = this;
744
      $('#multi_items_result input').keydown(function(event) {
745
      $('#multi_items_result input, #multi_items_position').keydown(function(event) {
745 746
        if(event.keyCode == KEY.ENTER) {
746 747
          event.preventDefault();
747 748
          self.add_multi_items();
templates/webpages/part/_multi_items_dialog.html
18 18
<div id='multi_items_result'></div>
19 19
<hr>
20 20

  
21
[%- IF FORM.show_pos_input -%]
22
  [% 'At position' | $T8 %]
23
  [% L.input_tag('multi_items.position', '', id='multi_items_position', size=5, class="numeric") %]
24
[%- END -%]
21 25
[% L.button_tag('', LxERP.t8('Continue'), id='continue_button') %]
22 26

  
23 27
</form>

Auch abrufbar als: Unified diff