Revision #2 has been created by Chris Backhouse on Jul 11, 2017, 1:48:23 PM with the memo:
list indentation
« previous (#1) next (#3) »
Changes
Title
unchanged
Yii2 Report Grid
Category
unchanged
Tips
Yii version
unchanged
Tags
changed
GridView, report
Content
changed
A Yii2 Gridview designed specifically for reporting
------------------
There are some very advanced grids in the Yii2 community, specifically Kartik's amazing gridview extensions but they all designed for interactive screen use.[...]
- **subTotal** : array | boolean, with the following options;
- - if set to true, then reportGrid uses the attribute value, summing the model->attribute or model->value amounts.
- - **value** : string|attribute name|closure ~ function($model, $key, $index, $widget, $break) {}, the value used by the totalling function as opposed to the value displayed.
- - **breakValue** : string|attribute name|closure ~ function($model, $key, $index, $widget, $break) {}, what to display in the sub-total cell. note the addition of the $break variable which can be used to determine the current break level.
For example: you may use if ($break!=1) return $model->some_amount; else return ' ';
- - **showOnBreak** | **hideOnBreak** : integer, show/hide the sub-total at the specified break level
- - **format** : boolean, uses the yii2 formatter to pre-format the cell contents eg: currency, html, text
- - **totalMethod** : the only available option at this stage is ReportColumn::TOTAL_BREAKDOWN, This will provide a summary table at the control break of this column values and summed values specified by totalOn.
- - **totalOn** : string|attribute name|closure ~ function($model, $key, $index, $widget, $break) { return $model->attribute; },, the value to be applied to the totalling.
Usage
```php[...]