'Unit.sort_order', 'hidden' => true); //$cols['Sort'] = array('index' => 'Unit.sort_order'); //$cols['Walk'] = array('index' => 'Unit.walk_order'); $cols['ID'] = array('index' => 'Unit.id', 'formatter' => 'id'); $cols['Unit'] = array('index' => 'Unit.name', 'width' => '50'); $cols['Size'] = array('index' => 'UnitSize.name', 'width' => '75'); $cols['Status'] = array('index' => 'Unit.status', 'width' => '75'); $cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency'); $cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment'); // Set up search fields if requested by caller if (isset($searchfields)) $grid->searchFields(array('Unit', 'Size', 'Status')); // Render the grid $grid ->columns($cols) ->sortField('Sort') ->defaultFields(array('Sort', 'ID', 'Unit')) ->render($this, isset($config) ? $config : null);