'Account.id', 'formatter' => 'id'); $cols['Name'] = array('index' => 'Account.name', 'formatter' => 'longname'); $cols['Type'] = array('index' => 'Account.type', 'formatter' => 'name'); $cols['Entries'] = array('index' => 'entries', 'width' => '60', 'align' => 'right'); $cols['Debits'] = array('index' => 'debits', 'formatter' => 'currency'); $cols['Credits'] = array('index' => 'credits', 'formatter' => 'currency'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Comment'] = array('index' => 'Account.comment', 'formatter' => 'comment'); // Set up search fields if requested by caller if (isset($searchfields)) $grid->searchFields(array('Name')); // Render the grid $grid ->columns($cols) ->sortField('Name') ->defaultFields(array('ID', 'Name')) ->render($this, isset($config) ? $config : null);