Revision fb722bcc
Von Bernd Bleßmann vor etwa 6 Jahren hinzugefügt
SL/Presenter/CustomerVendor.pm | ||
---|---|---|
62 | 62 |
my @classes = $params{class} ? ($params{class}) : (); |
63 | 63 |
push @classes, 'customer_vendor_autocomplete'; |
64 | 64 |
|
65 |
# do not use reserved html attribute 'type' for cv type |
|
66 |
$params{cv_type} = delete $params{type}; |
|
67 |
|
|
65 | 68 |
my $ret = |
66 | 69 |
input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id, |
67 | 70 |
'data-customer-vendor-picker-data' => JSON::to_json(\%params), |
js/kivi.CustomerVendor.js | ||
---|---|---|
271 | 271 |
'filter.all:substr:multi::ilike': term, |
272 | 272 |
'filter.obsolete': 0, |
273 | 273 |
current: this.$real.val(), |
274 |
type: this.o.type, |
|
274 |
type: this.o.cv_type,
|
|
275 | 275 |
}; |
276 | 276 |
}, |
277 | 277 |
set_item: function(item) { |
templates/webpages/customer_vendor/test_page.html | ||
---|---|---|
25 | 25 |
<br><hr> |
26 | 26 |
this one will be a reinit_widget after 4s:<br> |
27 | 27 |
<span id='vendor3' class="customer_vendor_picker"> |
28 |
<input id="vendor3_id" class="" type="hidden" name="vendor3_id" value="" data-customer-vendor-picker-data="{"type":"vendor"}"> |
|
28 |
<input id="vendor3_id" class="" type="hidden" name="vendor3_id" value="" data-customer-vendor-picker-data="{"cv_type":"vendor"}">
|
|
29 | 29 |
<input id="vendor3_id_name" type="text" name="" value=""> |
30 | 30 |
</span> |
31 | 31 |
|
Auch abrufbar als: Unified diff
CustomerVendor-Picker: 'type' nicht als html-Attribut setzen
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.