'MonetarySource.id', 'formatter' => 'id'); $cols['Name'] = array('index' => 'MonetarySource.name', 'formatter' => 'longname'); $cols['Type'] = array('index' => 'MonetaryType.name', 'formatter' => 'name'); $cols['Comment'] = array('index' => 'MonetarySource.comment', 'formatter' => 'comment'); // Set up search fields if requested by caller if (isset($searchfields)) $grid->searchFields(array('ID', 'Name')); // Render the grid $grid ->columns($cols) ->sortField('ID') ->defaultFields(array('ID', 'Name')) ->render($this, isset($config) ? $config : null);