Using formatter and add summary on gridview

0
4026
views

In this section, we will use formatter to change the format decimal, and add the total summary in kartik gridview.

Before start, we should read :
http://www.yiiframework.com/doc-2.0/guide-output-formatting.html
http://www.yiiframework.com/doc-2.0/guide-output-data-widgets.html
http://demos.krajee.com/grid

Add formatter in application components. Ie. my config in common/config/main.php

In above code, we set currency code to IDR (Rp), decimal (.), thousand (,) and locale id.

Add formatter and show summary in kartik gridview.

To change format with currency, uncomment format currency, and comment format decimal. Set showpageSummary true, and pageSummary true in column.

Reference :
http://www.yiiframework.com/doc-2.0/guide-output-formatting.html
http://www.yiiframework.com/doc-2.0/guide-output-data-widgets.html
http://demos.krajee.com/grid
https://github.com/redzjovi/yii2tutorial/commit/b06832fe3970b6cb61fff391f02b7c38298d95be

LEAVE A REPLY

Please enter your name here
Please enter your comment!