Diese war vorher fest auf 100 eingestellt. 100 bleibt die Voreinstellung.
}
sub action_multi_items_update_result {
- my $max_count = 100;
+ my $max_count = $::form->{limit};
my $count = $_[0]->multi_items_models->count;
if ($count == 0) {
my $text = escape($::locale->text('No results.'));
$_[0]->render($text, { layout => 0 });
- } elsif ($count > $max_count) {
+ } elsif ($max_count && $count > $max_count) {
my $text = escape($::locale->text('Too many results (#1 from #2).', $count, $max_count));
$_[0]->render($text, { layout => 0 });
} else {
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.
+If C<%params> contains C<multiple_limit> the alternative popup will not
+show any results if there are more than C<multiple_limit> results. A warning
+message is displayed in this case. Set C<multiple_limit> to 0 to disable
+the limitation. The limit defaults to 100.
+
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.
commit_none: function(){ },
commit_one: function(){ $('#update_button').click(); },
commit_many: function(){ self.open_dialog(); }
- }
+ },
+ multiple_limit: 100
}, $real.data('part-picker-data'), options);
this.$real = $real;
this.real_id = $real.attr('id');
update_results: function() {
var self = this;
var data = $('#multi_items_form').serializeArray();
- data.push({ name: 'type', value: self.pp.type });
+ data.push({ name: 'type', value: self.pp.type });
+ data.push({ name: 'limit', value: self.pp.o.multiple_limit });
var ppdata = self.pp.ajax_data(function(){
var val = $('#multi_items_filter').val();
return val === undefined ? '' : val
All parts including customer partnumbers of all customers: <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) %]
+single select dialog for glass-popup-button; multi select with extra button (and limited to 5 results):<br>
+[% P.part.picker('part_id31', undef, multiple=0, multiple_limit=5) %]
[% 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>