'Lease.id', 'hidden' => true); $cols['Lease'] = array('index' => 'Lease.number', 'formatter' => 'id'); $cols['Unit'] = array('index' => 'Unit.name', 'width' => '50', 'align' => 'center'); $cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname'); $cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date'); $cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date'); $cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date'); $cols['Balance'] = array('index' => 'Lease.balance', 'formatter' => 'currency', 'sortable'=>false); $cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'leases', 'caption' => isset($caption) ? $caption : null); if (isset($leases)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $leases), 'limit' => 5); } else { $jqGrid_options += array('search_fields' => array('Customer', 'Unit')); } $jqGrid_options['sort_column'] = 'LeaseID'; echo $this->element('jqGrid', $jqGrid_options);