From fb722bccec95135d99e8b2b717aece44c71141ad Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Sat, 25 Aug 2018 16:12:58 +0200 Subject: [PATCH] CustomerVendor-Picker: 'type' nicht als html-Attribut setzen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- SL/Presenter/CustomerVendor.pm | 3 +++ js/kivi.CustomerVendor.js | 2 +- templates/webpages/customer_vendor/test_page.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/Presenter/CustomerVendor.pm b/SL/Presenter/CustomerVendor.pm index 4a563e46c..ab951720a 100644 --- a/SL/Presenter/CustomerVendor.pm +++ b/SL/Presenter/CustomerVendor.pm @@ -62,6 +62,9 @@ sub customer_vendor_picker { 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), diff --git a/js/kivi.CustomerVendor.js b/js/kivi.CustomerVendor.js index 6ee499a54..e9b22bedf 100644 --- a/js/kivi.CustomerVendor.js +++ b/js/kivi.CustomerVendor.js @@ -271,7 +271,7 @@ namespace('kivi.CustomerVendor', function(ns) { '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) { diff --git a/templates/webpages/customer_vendor/test_page.html b/templates/webpages/customer_vendor/test_page.html index 94d29fb1f..198a64ce0 100644 --- a/templates/webpages/customer_vendor/test_page.html +++ b/templates/webpages/customer_vendor/test_page.html @@ -25,7 +25,7 @@ fat vendor with change


this one will be a reinit_widget after 4s:
- + -- 2.20.1