'id_sequence', 'formatter' => 'id'); $cols['Account'] = array('index' => 'Account.name', 'formatter' => 'name', 'width' => '250'); $cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right'); $cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency'); $cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Close Date'] = array('index' => 'Ledger.close_stamp', 'formatter' => 'date'); $cols['Comment'] = array('index' => 'Ledger.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'ledgers', 'caption' => isset($caption) ? $caption : null); 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')); } echo $this->element('jqGrid', $jqGrid_options);