Added mechanism to easily create links in the listing grids. I'm not very keen on how it works, but it's good enough for the moment, unless/until I figure out how to push this to the view. If it should stay in the controller, I'm sure a more sophisticated mechanism will be required.

git-svn-id: file:///svn-source/pmgr/branches/ledger_transactions_20090605@128 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-06-15 02:50:21 +00:00
parent 2b9369b823
commit 1890a0490e
3 changed files with 39 additions and 3 deletions

View File

@@ -51,8 +51,8 @@ class LeasesController extends AppController {
function jqGridDataTables(&$params, &$model) {
return array
('link' => array('Unit' => array('fields' => array('Unit.name')),
'Customer' => array('fields' => array('Customer.name'))));
('link' => array('Unit' => array('fields' => array('Unit.id', 'Unit.name')),
'Customer' => array('fields' => array('Customer.id', 'Customer.name'))));
}
function jqGridDataConditions(&$params, &$model) {
@@ -68,6 +68,12 @@ class LeasesController extends AppController {
return $conditions;
}
function jqGridRecordLinks(&$params, &$model, &$records, $links) {
$links['Lease'] = array('number');
$links['Unit'] = array('name');
return parent::jqGridRecordLinks($params, $model, $records, $links);
}
function jqGridDataRecords(&$params, &$model, $query) {
$leases = parent::jqGridDataRecords($params, $model, $query);