'Account.id', 'formatter' => 'id'); $cols['Name'] = array('index' => 'Account.name', 'formatter' => 'name', 'width' => '250'); $cols['Type'] = array('index' => 'Account.type', 'width' => '60'); $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['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'accounts', 'caption' => isset($caption) ? $caption : null); if (isset($accounts)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $accounts), 'limit' => 5); } else { $jqGrid_options += array('search_fields' => array('Name')); } echo $this->element('jqGrid', $jqGrid_options);