my $ret =
$self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id) .
- join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(type unit convertible_unit)) .
+ join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(part_type unit convertible_unit)) .
$self->input_tag("", ref $value ? $value->displayable_name : '', id => "${id}_name", %params);
$::request->layout->add_javascripts('autocomplete_part.js');
C<$value> can be a parts id or a C<Rose::DB:Object> instance.
-If C<%params> contains C<type> only parts of this type will be used
+If C<%params> contains C<part_type> only parts of this type will be used
for autocompletion. You may comma separate multiple types as in
C<part,assembly>.
UNDEFINED: CLASSES.UNDEFINED
}
var real_id = $real.attr('id');
- var $dummy = $('#' + real_id + '_name');
- var $type = $('#' + real_id + '_type');
- var $unit = $('#' + real_id + '_unit');
+ var $dummy = $('#' + real_id + '_name');
+ var $part_type = $('#' + real_id + '_part_type');
+ var $unit = $('#' + real_id + '_unit');
var $convertible_unit = $('#' + real_id + '_convertible_unit');
var state = STATES.PICKED;
var last_real = $real.val();
current: $real.val(),
};
- if ($type && $type.val())
- data['filter.type'] = $type.val().split(',');
+ if ($part_type && $part_type.val())
+ data['filter.part_type'] = $part_type.val().split(',');
if ($unit && $unit.val())
data['filter.unit'] = $unit.val().split(',');
var pp = {
real: function() { return $real },
dummy: function() { return $dummy },
- type: function() { return $type },
+ part_type: function() { return $part_type },
unit: function() { return $unit },
convertible_unit: function() { return $convertible_unit },
update_results: update_results,
Alle: <br>
[% L.part_picker('part_id') %] text<br>
Nur Waren: <br>
-[% L.part_picker('part_id2', undef, type='part') %]<br>
+[% L.part_picker('part_id2', undef, part_type='part') %]<br>
Nur Dienstleistungen: <br>
-[% L.part_picker('part_id3', undef, type='service') %]<br>
+[% L.part_picker('part_id3', undef, part_type='service') %]<br>
Waren und Dienstleistungen: <br>
-[% L.part_picker('part_id4', undef, type='part,service') %]<br>
+[% L.part_picker('part_id4', undef, part_type='part,service') %]<br>
Pre-filled:<br>
[% L.part_picker('part_id5', pre_filled_part) %]<br>
Convertible unit 'Std': (only select parts with unit Tag/Std/Min)<br>
<h2>Styling</h2>
-Ina span:
-<span>Leading text: [% L.part_picker('p1', undef, type='part,service') %] and text after with spacing</span><br>
-<span>Leading text:[% L.part_picker('p2', undef, type='part,service') %]and text after without spacing</span><br>
-<div>Leading text: [% L.part_picker('p3', undef, type='part,service') %] and text after with spacing with div</div><br>
-<div>Leading text:[% L.part_picker('p4', undef, type='part,service') %]and text after with spacing with div</div><br>
+In a span:
+<span>Leading text: [% L.part_picker('p1', undef, part_type='part,service') %] and text after with spacing</span><br>
+<span>Leading text:[% L.part_picker('p2', undef, part_type='part,service') %]and text after without spacing</span><br>
+<div>Leading text: [% L.part_picker('p3', undef, part_type='part,service') %] and text after with spacing with div</div><br>
+<div>Leading text:[% L.part_picker('p4', undef, part_type='part,service') %]and text after with spacing with div</div><br>
-<span>Picker + input next to each other: [% L.part_picker('p5', undef, type='part,service', width="100%") %]<input type=text></span>
+<span>Picker + input next to each other: [% L.part_picker('p5', undef, part_type='part,service', width="100%") %]<input type=text></span>
-<div>[% L.part_picker('p6', undef, type='part,service', style="width:500px") %] 500px width</div>
-<div>[% L.part_picker('p7', undef, type='part,service', style="width:200px") %] 200px width</div>
-<div>[% L.part_picker('p8', undef, type='part,service', style="height:40px") %] 40px height</div>
+<div>[% L.part_picker('p6', undef, part_type='part,service', style="width:500px") %] 500px width</div>
+<div>[% L.part_picker('p7', undef, part_type='part,service', style="width:200px") %] 200px width</div>
+<div>[% L.part_picker('p8', undef, part_type='part,service', style="height:40px") %] 40px height</div>
[%# FOREACH i IN 1..50 %]
[%# L.part_picker('part_id_' _ i) %] <br>
<table>
<tr>
<th>Part picker in table heading</th>
- <th>[% L.part_picker('p9', undef, type='part,service') %]</th>
+ <th>[% L.part_picker('p9', undef, part_type='part,service') %]</th>
</tr>
<tr>
<td>Part picker in table cell</td>
- <td>[% L.part_picker('p10', undef, type='part,service') %]</td>
+ <td>[% L.part_picker('p10', undef, part_type='part,service') %]</td>
</tr>
</table>
<table>
<tr class=listheading>
<th>Part picker in table heading</th>
- <th>[% L.part_picker('p11', undef, type='part,service') %]</th>
+ <th>[% L.part_picker('p11', undef, part_type='part,service') %]</th>
</tr>
<tr class=listrow>
<td>Part picker in table cell</td>
- <td>[% L.part_picker('p12', undef, type='part,service') %]</td>
+ <td>[% L.part_picker('p12', undef, part_type='part,service') %]</td>
</tr>
</table>