Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 715fc205

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

  • ID 715fc205c36442d710302cb48934b394036e881c
  • Vorgänger 47f52acc
  • Nachfolger 1c3c31c2

PartPicker: Option für Mehrfachauswahl als default merken

Damit lässt sich die Option via js ändern, um z.B. einen Dialog
mit Mehrfachauswahl über einen Knopf zu öffnen, während die
Funktion der Lupe bei der Einfachauswahl bleibt (oder andersherum).

Unterschiede anzeigen:

SL/Presenter/Part.pm
parts will be used for autocompletion which partnumber is a vendor partnumber
(makemodel) or a customer partnumber.
If C<%params> contains C<multiple> an alternative popup will be opened,
allowing multiple items to be selected. Note however that this requires
an additional callback C<set_multi_items> to work.
Also note that you can set C<multiple> to 0 (or not set C<multiple>) on
creation of the picker, but can open the alternative multi select popup
with js like this:
C<$("#pp_id").data("part_picker").o.multiple=1; $("#pp_id").data("part_picker").open_dialog()'>
where C<pp_id> is the dom id of the part picker.
Or you can even do it the other way round setting C<multiple> to 1 on creation
and open a single selection popup with js.
Obsolete parts will by default not be displayed for selection. However they are
accepted as default values and can persist during updates. As with other
selectors though, they are not selectable once overridden.
......
undefined.
After that the action C<commit_one> will be executed, which defaults to
opening a popup dialog for graphical interaction. If C<params> contains
C<multiple> an alternative popup will be opened, allowing multiple items to be
selected. Note however that this requires an additional callback
C<set_multi_items> to work.
opening a popup dialog for graphical interaction.
=item * C<commit_none>
js/kivi.Part.js
this.last_dummy = this.$dummy.val();
this.timer = undefined;
this.dialog = undefined;
this.multiple_default = this.o.multiple;
this.init();
};
......
},
open_dialog: function() {
if (this.o.multiple) {
this.o.multiple = this.multiple_default;
this.dialog = new ns.PickerMultiPopup(this);
} else {
this.dialog = new ns.PickerPopup(this);
templates/webpages/part/test_page.html
[% P.part.picker('part_id14', undef, classification_id='1,2,4') %]<br>
Artikel-Status: Aktiv (default)<br>
[% P.part.picker('part_id15') %]<br>
Artikel-Status: Aktiv< (explizit)<br>
Artikel-Status: Aktiv (explizit)<br>
[% P.part.picker('part_id16', undef, status="active") %]<br>
Artikel-Status: Ungültig<br>
[% P.part.picker('part_id17', undef, status="obsolete") %]<br>
......
With multi select popup<br>
[% P.part.picker('part_id8', undef, multiple=1) %]<br>
With multi select popup (only obsolete)<br>
[% P.part.picker('part_id8', undef, multiple=1, status='obsolete') %]<br>
[% P.part.picker('part_id9', undef, multiple=1, status='obsolete') %]<br>
<br>
All parts including make models of all vendors: <br>
[% P.part.picker('part_id', undef, with_makemodel=1) %]<br>
[% P.part.picker('part_id21', undef, with_makemodel=1) %]<br>
All parts including make models of all vendors with multi select popup: <br>
[% P.part.picker('part_id', undef, with_makemodel=1, multiple=1) %]<br>
[% P.part.picker('part_id22', undef, with_makemodel=1, multiple=1) %]<br>
All parts including customer partnumbers of all customers: <br>
[% P.part.picker('part_id', undef, with_customer_partnumber=1) %]<br>
[% P.part.picker('part_id23', undef, with_customer_partnumber=1) %]<br>
<br>
single select dialog for glass-popup-button; multi select with extra button:<br>
[% P.part.picker('part_id31', undef, multiple=0) %]
[% L.button_tag('$("#part_id31").data("part_picker").o.multiple=1; $("#part_id31").data("part_picker").open_dialog()', 'Add multiple items') %]<br>
<h2>Styling</h2>

Auch abrufbar als: Unified diff