'Tender.id', 'formatter' => 'id'); $cols['Date'] = array('index' => 'Transaction.stamp', 'formatter' => 'date'); $cols['Customer'] = array('index' => 'Customer.name', 'formatter' => 'longname'); $cols['Item'] = array('index' => 'Tender.name', 'formatter' => 'longname'); $cols['Type'] = array('index' => 'TenderType.name', 'formatter' => 'name'); $cols['Comment'] = array('index' => 'Tender.comment', 'formatter' => 'comment'); $cols['Amount'] = array('index' => 'LedgerEntry.amount', 'formatter' => 'currency'); $cols['Sub-Total'] = array('index' => 'subtotal-LedgerEntry.amount', 'formatter' => 'currency'); // Render the grid $grid ->columns($cols) ->sortField('Date') ->defaultFields(array('Date', 'Name', 'Amount')) ->searchFields(array('Name', 'Type')) ->render($this, isset($config) ? $config : null, array_diff(array_keys($cols), array('Sub-Total')));