Revision ee74ea82
Von Sven Schöling vor mehr als 10 Jahren hinzugefügt
SL/Presenter/Part.pm | ||
---|---|---|
29 | 29 |
|
30 | 30 |
$value = SL::DB::Manager::Part->find_by(id => $value) if $value && !ref $value; |
31 | 31 |
my $id = delete($params{id}) || $self->name_to_id($name); |
32 |
my $fat_set_item = delete $params{fat_set_item}; |
|
33 |
|
|
34 |
my @classes = $params{class} ? ($params{class}) : (); |
|
35 |
push @classes, 'part_autocomplete'; |
|
36 |
push @classes, 'partpicker_fat_set_item' if $fat_set_item; |
|
32 | 37 |
|
33 | 38 |
my $ret = |
34 |
$self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => 'part_autocomplete', type => 'hidden', id => $id) .
|
|
39 |
$self->input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id) .
|
|
35 | 40 |
join('', map { $params{$_} ? $self->input_tag("", delete $params{$_}, id => "${id}_${_}", type => 'hidden') : '' } qw(column type unit convertible_unit)) . |
36 | 41 |
$self->input_tag("", (ref $value && $value->can('description')) ? $value->description : '', id => "${id}_name", %params); |
37 | 42 |
|
js/autocomplete_part.js | ||
---|---|---|
16 | 16 |
var o = $.extend({ |
17 | 17 |
limit: 20, |
18 | 18 |
delay: 50, |
19 |
fat_set_item: 0, // use this option to get a fat item json with all |
|
20 |
// relevant data instead of the guaranteed id + name |
|
19 |
fat_set_item: $real.hasClass('partpicker_fat_set_item'), |
|
21 | 20 |
}, options); |
22 | 21 |
var STATES = { |
23 | 22 |
UNIQUE: 1, |
Auch abrufbar als: Unified diff
P.part_picker reicht jetzt das flag fat_set_item durch und schluckt nicht mehr class