X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-table.html;h=741e51e494e3a8630ac1e59e39c3667c080a33d8;hb=38458c0c9135228828b5a477ed1710ef687ec3d3;hp=e7baaf53b0e49f3ef9b01de1ebe5a6cbd3e37cf3;hpb=e3c3d86b7091d806af42e40475a28ea8afb5865c;p=freeside.git diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index e7baaf53b..741e51e49 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -29,11 +29,16 @@ Example: #or 'records' => \@records, #instead of search params + #instead of the primary key... only for special cases + 'value_col' => 'columnname', + #basic params controlling the resulting @@ -44,6 +49,10 @@ Example: # %} @@ -94,6 +127,8 @@ my( %opt ) = @_; warn "elements/select-table.html: \n". Dumper(%opt) if exists $opt{debug} && $opt{debug}; +$opt{'extra_option_attributes'} ||= []; + my $onchange = ''; if ( $opt{'onchange'} ) { $onchange = $opt{'onchange'}; @@ -106,7 +141,7 @@ if ( $opt{'onchange'} ) { my $dbdef_table = dbdef->table($opt{'table'}) or die "can't find dbdef for ". $opt{'table'}. " table\n"; -my $key = $dbdef_table->primary_key; #? $opt{'primary_key'} || +my $key = $opt{'value_col'} || $dbdef_table->primary_key; my $name_col = $opt{'name_col'}; @@ -159,6 +194,7 @@ if ( ref( $value ) eq 'ARRAY' ) { $value = { map { $_ => 1 } @$value }; } -my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : (); +my @pre_options = $opt{pre_options} ? @{ $opt{pre_options} } : (); +my @post_options = $opt{post_options} ? @{ $opt{post_options} } : ();