$::form->{sort_by} = 'customer_and_description';
+ my $description_style = ($::form->{description_style} =~ m{both|number|description|full})
+ ? $::form->{description_style}
+ : 'full';
+
my @hashes = map {
+{
- value => $_->full_description(style => 'full'),
- label => $_->full_description(style => 'full'),
+ value => $_->full_description(style => $description_style),
+ label => $_->full_description(style => $description_style),
id => $_->id,
projectnumber => $_->projectnumber,
description => $_->description,
push @classes, 'project_autocomplete';
- my %data_params = map { $_ => delete $params{$_} } grep { defined $params{$_} } qw(customer_id active valid);
+ my %data_params = map { $_ => delete $params{$_} } grep { defined $params{$_} } qw(customer_id active valid description_style);
my $ret =
input_tag($name, (ref $value && $value->can('id') ? $value->id : ''), class => "@classes", type => 'hidden', id => $id,
data['filter.valid'] = 'valid'; // default
}
+ if (o.description_style)
+ data['description_style'] = o.description_style;
+
return data;
}
[% P.project.picker('project12_id', '', active='both', valid='both',style='width: 300px') %] all (active, inactive, valid, invalid)
<br>
+<br>
+[% P.project.picker('project13_id', '', style='width: 300px') %] description style full (default)
+<br>
+
+<br>
+[% P.project.picker('project14_id', '', description_style='full', style='width: 300px') %] description style full (explicit)
+<br>
+
+<br>
+[% P.project.picker('project15_id', '', description_style='both', style='width: 300px') %] description style both
+<br>
+
+<br>
+[% P.project.picker('project16_id', '', description_style='number', style='width: 300px') %] description style number
+<br>
+
+<br>
+[% P.project.picker('project17_id', '', description_style='description', style='width: 300px') %] description style description
+<br>
+
+<br>
+
Runtime test:<br>
<div id='runtime_picker'>'