'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['Rent'] = array('index' => 'Lease.rent', 'formatter' => 'currency', 'hiddenz' => true); $cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'currency', 'hiddenz' => true); $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' => 'balance', 'formatter' => 'currency'); $cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment'); $custom_post_data = compact('nothing'); $jqGrid_options = array('jqGridColumns' => $cols, 'controller' => 'leases'); $jqGrid_options += compact('action', 'caption', 'grid_div_id', 'grid_div_class', 'grid_id', 'grid_setup', 'nolinks', 'limit'); if (isset($leases)) { $jqGrid_options += array('custom_ids' => array_map(create_function('$data', 'return $data["id"];'), $leases), 'limit' => 5); } if (isset($searchfields)) { $jqGrid_options += array('search_fields' => array('Customer', 'Unit')); } $jqGrid_options += compact('custom_post_data'); $jqGrid_options['sort_column'] = 'LeaseID'; echo $this->element('jqGrid', $jqGrid_options);