schmasterz / yii2-widget-ag-grid
Yii2 wrapper for ag-grid.
Installs: 31
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- php: ^7.1
- bower-asset/ag-grid: *
- yiisoft/yii2: ~2.0.14
This package is auto-updated.
Last update: 2025-03-12 06:22:04 UTC
README
This extension provides the agGrid integration for the Yii2 framework.
Requirements
The minimum requirement by yii2-widget-ag-grid that your Web server supports PHP 7.1.
Install via Composer
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
Run
$ php composer.phar require schmasterz/yii2-widget-ag-grid "master@dev"
Usage
<?= \schmasterz\agGrid\AgGridWidget::widget([ 'id' => 'ag-grid', 'options' => [ 'style' => 'height: 600px;width:500px;' ], 'gridOptions' => [ 'columnDefs' => [ ['headerName' => 'Make', 'field' => 'make', 'sortable' => true], ['headerName' => 'Model', 'field' => 'model', 'sortable' => true], ['headerName' => 'Price', 'field' => 'price', 'sortable' => true], ], ] ]); ?>
You can also use agGrid in the JavaScript layer of your application. To achieve this, you need to include agGrid as a dependency of your Asset file
public $depends = [ 'schmasterz\agGrid\AgGridAsset', ];
or add it to your view file
schmasterz\agGrid\AgGridAsset::register($this);