'Contact.id', 'formatter' => 'id'); $cols['Last Name'] = array('index' => 'Contact.last_name', 'formatter' => 'name'); $cols['First Name'] = array('index' => 'Contact.first_name', 'formatter' => 'name'); $cols['Company'] = array('index' => 'Contact.company_name', 'formatter' => 'longname'); if (0) { // REVISIT: Need to figure out how to put this in play $cols['Type'] = array('index' => 'ContactsCustomer.type', 'width' => '75'); $cols['Active'] = array('index' => 'ContactsCustomer.active', 'width' => '75'); } $cols['Comment'] = array('index' => 'Contact.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'contacts', 'caption' => isset($caption) ? $caption : null); if (isset($contacts)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $contacts), 'limit' => 5); } else { $jqGrid_options += array('search_fields' => array('Last Name', 'First Name')); } echo $this->element('jqGrid', $jqGrid_options);