'UnitSize.name', 'formatter' => 'shortname'); $cols['Width'] = array('index' => 'UnitSize.width', 'formatter' => 'number'); $cols['Depth'] = array('index' => 'UnitSize.depth', 'formatter' => 'number'); $cols['Height'] = array('index' => 'UnitSize.height', 'formatter' => 'number'); $cols['Area'] = array('index' => 'sqft', 'formatter' => 'number'); $cols['Volume'] = array('index' => 'cuft', 'formatter' => 'number'); $cols['Deposit'] = array('index' => 'UnitSize.deposit', 'formatter' => 'currency'); $cols['Rent'] = array('index' => 'UnitSize.rent', 'formatter' => 'currency'); $cols['A. Cost'] = array('index' => 'sqcost', 'formatter' => 'currency'); $cols['V. Cost'] = array('index' => 'cucost', 'formatter' => 'currency'); $cols['Unavailable'] = array('index' => 'unavailable', 'formatter' => 'number'); $cols['Occupied'] = array('index' => 'occupied', 'formatter' => 'number'); $cols['Available'] = array('index' => 'available', 'formatter' => 'number'); $cols['Total'] = array('index' => 'units', 'formatter' => 'number'); $cols['Occupancy'] = array('index' => 'occupancy', 'formatter' => 'percentage', 'formatoptions' => array('precision' => 0)); $cols['Vacancy'] = array('index' => 'vacancy', 'formatter' => 'percentage', 'formatoptions' => array('precision' => 0)); $cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment'); // Render the grid $grid ->columns($cols) ->sortField('Area') ->defaultFields(array('Size', 'Area')) ->searchFields(array('Size', 'Width', 'Depth', 'Area', 'Deposit', 'Rent')) ->render($this, isset($config) ? $config : null, array_diff(array_keys($cols), array('Height', 'Volume', 'A. Cost', 'V. Cost', 'Occupied', 'Total', 'Occupancy', 'Vacancy', 'Comment')));