summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-table.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/select-table.html')
-rw-r--r--httemplate/elements/select-table.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html
index 0b04fee6e..4b6ddb40e 100644
--- a/httemplate/elements/select-table.html
+++ b/httemplate/elements/select-table.html
@@ -28,6 +28,7 @@ Example:
'agent_null_right' => '', #right to see un-agented entries
#or
'records' => \@records, #instead of search params
+ 'presorted' => 0, #set true to disable sorting the records on name_col
#instead of the primary key... only for special cases
'value_col' => 'columnname',
@@ -176,8 +177,9 @@ if ( $opt{'agent_virt'} ) {
my @records = ();
if ( $opt{'records'} ) {
- @records = sort { $a->get($name_col) cmp $b->get($name_col) }
- @{ $opt{'records'} };
+ @records = @{ $opt{'records'} };
+ @records = sort { $a->get($name_col) cmp $b->get($name_col) } @records
+ unless $opt{'presorted'};
} else {
@records = qsearch( {
'table' => $opt{'table'},