'MonetarySource.id', 'formatter' => 'id'); $cols['Name'] = array('index' => 'MonetarySource.name', 'formatter' => 'longname'); $cols['Type'] = array('index' => 'MonetaryType.name', 'formatter' => 'name'); $cols['Comment'] = array('index' => 'MonetarySource.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'monetary_sources', 'caption' => isset($caption) ? $caption : null); if (isset($monetary_sources)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $monetary_sources), 'limit' => 5); } echo $this->element('jqGrid', $jqGrid_options);