'Unit.id', 'formatter' => 'id'); $cols['Unit'] = array('index' => 'Unit.name', 'width' => '50'); $cols['Size'] = array('index' => 'UnitSize.name', 'width' => '75'); $cols['Status'] = array('index' => 'Unit.status', 'width' => '75'); $cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'units', 'caption' => isset($caption) ? $caption : null); if (isset($units)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $units), 'limit' => 5); } else { $jqGrid_options += array('search_fields' => array('Unit', 'Size', 'Status')); } echo $this->element('jqGrid', $jqGrid_options);