From 9be50d3a150fde70377e0f10bc25d10cd155557b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 11 Jul 2013 10:34:00 +0200 Subject: [PATCH] multiple types --- js/autocomplete_part.js | 9 +++++---- templates/webpages/part/test_page.html | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/autocomplete_part.js b/js/autocomplete_part.js index 00bdc5dd6..8e95d8d47 100644 --- a/js/autocomplete_part.js +++ b/js/autocomplete_part.js @@ -29,11 +29,12 @@ namespace('kivi', function(k){ function ajax_data(term) { return { - 'filter.all:substr::ilike': term, - 'filter.type': function() { return $type.val() }, + 'filter.all:substr::ilike': term, + // due to a bug in $.param functions returning arrays don't get serialized correctly, so call it manually + 'filter.type': $type.val().split(','), 'filter.obsolete': 0, - column: function() { return $column.val()===undefined ? '' : $column.val() }, - current: function() { return $real.val() }, + column: $column.val()===undefined ? '' : $column.val(), + current: $real.val(), } } diff --git a/templates/webpages/part/test_page.html b/templates/webpages/part/test_page.html index 3d285185e..202b5d3cd 100644 --- a/templates/webpages/part/test_page.html +++ b/templates/webpages/part/test_page.html @@ -9,3 +9,5 @@ Nur Waren:
[% L.part_picker('part_id2', undef, type='part') %]
Nur Dienstleistungen:
[% L.part_picker('part_id3', undef, type='service') %]
+Waren und Dienstleistungen:
+[% L.part_picker('part_id4', undef, type='part,service') %]
-- 2.20.1