Moved all grid elements onto the grid helper. Basic testing done, but more testing needs to be done.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@262 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -12,25 +12,13 @@ $cols['Debits'] = array('index' => 'debits', 'formatter' => 'c
|
||||
$cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency');
|
||||
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
|
||||
|
||||
$custom_post_data = compact('nothing');
|
||||
$jqGrid_options = array('jqGridColumns' => $cols,
|
||||
'controller' => 'ledgers',
|
||||
);
|
||||
$jqGrid_options += compact('grid_div_id', 'grid_id', 'caption', 'grid_setup', 'limit');
|
||||
// Set up search fields if requested by caller
|
||||
if (isset($searchfields))
|
||||
$grid->searchFields(array('Account', 'Comment'));
|
||||
|
||||
|
||||
if (isset($ledgers)) {
|
||||
$jqGrid_options += array('custom_ids' =>
|
||||
array_map(create_function('$data',
|
||||
'return $data["id"];'),
|
||||
$ledgers),
|
||||
'limit' => 5);
|
||||
}
|
||||
else {
|
||||
$jqGrid_options += array('search_fields' => array('Account'));
|
||||
}
|
||||
|
||||
$jqGrid_options += compact('custom_post_data');
|
||||
$jqGrid_options['sort_column'] = 'ID';
|
||||
$jqGrid_options['sort_order'] = 'DESC';
|
||||
echo $this->element('jqGrid', $jqGrid_options);
|
||||
// Render the grid
|
||||
$grid
|
||||
->columns($cols)
|
||||
->sortField('ID', 'DESC')
|
||||
->defaultFields(array('ID', 'Account'))
|
||||
->render($this, isset($config) ? $config : null);
|
||||
|
||||
Reference in New Issue
Block a user