Die Parameter des Picker-Aufrufs werden an das Input-Tag weitergeben und so
wurde das type-Attribut mit dem Typ (customer/vendor) des Pickers
überschrieben.
my @classes = $params{class} ? ($params{class}) : ();
push @classes, 'customer_vendor_autocomplete';
+ # do not use reserved html attribute 'type' for cv type
+ $params{cv_type} = delete $params{type};
+
my $ret =
input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id,
'data-customer-vendor-picker-data' => JSON::to_json(\%params),
'filter.all:substr:multi::ilike': term,
'filter.obsolete': 0,
current: this.$real.val(),
- type: this.o.type,
+ type: this.o.cv_type,
};
},
set_item: function(item) {
<br><hr>
this one will be a reinit_widget after 4s:<br>
<span id='vendor3' class="customer_vendor_picker">
-<input id="vendor3_id" class="" type="hidden" name="vendor3_id" value="" data-customer-vendor-picker-data="{"type":"vendor"}">
+<input id="vendor3_id" class="" type="hidden" name="vendor3_id" value="" data-customer-vendor-picker-data="{"cv_type":"vendor"}">
<input id="vendor3_id_name" type="text" name="" value="">
</span>