http://code.google.com/p/scu-smp/source/detail?r=285
Modified:
/trunk/smp-php/smp/datagrid/GenericDatagrid.php
/trunk/smp-php/smp/service/LogService.php
=======================================
--- /trunk/smp-php/smp/datagrid/GenericDatagrid.php Fri Oct 1 01:30:37 2010
+++ /trunk/smp-php/smp/datagrid/GenericDatagrid.php Mon Oct 11 23:26:54 2010
@@ -9,7 +9,7 @@
require_once('smp/datagrid/Datagrid.php');
class smp_datagrid_GenericDatagrid extends smp_datagrid_Datagrid {
- function getDatagrid($tableName, $domain = null) {
+ function getDatagrid($tableName, $domain = null, $sortField = 'id',
$sortDir = 'ASC') {
$searchCriteria = (!is_null($domain) ?
self::getSearchCriteria($domain, '', false) : "");
@@ -17,6 +17,7 @@
$query = "SELECT * FROM ".$tableName.$whereCondition;
+ self::$datagrid->setDefaultSort(array($sortField => $sortDir));
self::$datagrid->bind($query, self::$options);
return self::$datagrid;
=======================================
--- /trunk/smp-php/smp/service/LogService.php Tue Sep 21 05:27:40 2010
+++ /trunk/smp-php/smp/service/LogService.php Mon Oct 11 23:26:54 2010
@@ -15,7 +15,7 @@
}
function getDatagrid() {
- return $this->genericDatagrid->getDatagrid(Constants::TABLE_LOG);
+ return $this->genericDatagrid->getDatagrid(Constants::TABLE_LOG,
null, 'id', 'DESC');
}
}