Files
pmgr/views/elements/leases.ctp
abijah 18e1f4986a Since Lease.number is a VARCHAR, it doesn't sort well. So I added a hidden column for Lease.id, which sorts better.
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629/site@192 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-06-30 17:56:32 +00:00

32 lines
1.4 KiB
PHP

<?php /* -*- mode:PHP -*- */
// Define the table columns
$cols = array();
$cols['LeaseID'] = array('index' => '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);