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_pos_input> an input field with the dom id
+C<multi_items_position> will be rendered in the alternative popup.
+This can be used in the callback for C<set_multi_items> to controll the
+input postion for the items.
+
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
url: 'controller.pl?action=Part/show_multi_items_dialog',
data: $.extend({
real_id: self.pp.real_id,
+ show_pos_input: self.pp.o.multiple_pos_input,
}, self.pp.ajax_data(this.pp.$dummy.val())),
id: 'jq_multi_items_dialog',
dialog: {
$('#jq_multi_items_dialog').dialog('close');
},
disable_continue: function() {
- $('#multi_items_result input').off("keydown");
+ $('#multi_items_result input, #multi_items_position').off("keydown");
$('#continue_button').prop('disabled', true);
},
enable_continue: function() {
var self = this;
- $('#multi_items_result input').keydown(function(event) {
+ $('#multi_items_result input, #multi_items_position').keydown(function(event) {
if(event.keyCode == KEY.ENTER) {
event.preventDefault();
self.add_multi_items();
<div id='multi_items_result'></div>
<hr>
+[%- IF FORM.show_pos_input -%]
+ [% 'At position' | $T8 %]
+ [% L.input_tag('multi_items.position', '', id='multi_items_position', size=5, class="numeric") %]
+[%- END -%]
[% L.button_tag('', LxERP.t8('Continue'), id='continue_button') %]
</form>