'Map.id', 'formatter' => 'id'); $cols['Name'] = array('index' => 'Map.name', 'formatter' => 'longname'); $cols['Site Area'] = array('index' => 'SiteArea.name', 'formatter' => 'longname'); $cols['Width'] = array('index' => 'Map.width', 'width' => '50', 'align' => 'right'); $cols['Depth'] = array('index' => 'Map.depth', 'width' => '50', 'align' => 'right'); $cols['Comment'] = array('index' => 'Map.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);