
yyang at cidc
Nov 3, 2009, 8:24 AM
Post #1 of 1
(101 views)
Permalink
|
|
OrderBy customized column value
|
|
We added an extra customized column in the Admin/Users/index.html. The column name is called "LastAccessTime". The purpose is to display the last access time of the user. It is combined with the Config "AutoLogoff" setting and the customized function to retrieve the "LastUpdated" value from the "sessions" table. We added the function at the callback: /local/html/Callbacks/xx/Elements/RT__User/ColumnMap/ColumnMap: sub get_last_access { my $User = shift; my $lastAccessed; my $sessions = $User->get_sessions; $lastAccessed = $sessions->{$User->id} || ""; return $lastAccessed; } $COLUMN_MAP->{'LastAccessTime'}->{value} = \&get_last_access; $COLUMN_MAP->{'LastAccessTime'}->{title} = "Last Access Time"; Everything went well, except that this additional column is not sortable. Since the value is computed and the "attribute" is not in the database, we are wondering if it is possible to use the "OrderBy" param. Any idea on how to sort this customized column? Thanks a lot! Yan
|