fahada305 / yii2-fagrid
FaGrid jQuery based table grid view
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2025-07-09 00:48:41 UTC
README
FaGrid jQuery based table grid view
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist fahada305/yii2-fagrid "*"
or add
"fahada305/yii2-fagrid": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
in your Controller create function for getting data
make sure resposne format must be json
and query must asArray
namespace app\controllers; .......... ......... public function actionData() { $model = Category::find()->asArray()->all(); \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return $model; } ........ ........ .......
In Your View file
$dataUrl = "category/data"; // "controller->id/action->id or "module->id/controller->id/action->id" $columns = [ ['name' => 'name'], ['name' => 'type'], ['name' => 'description'], ]; <?=\fahada305\fagrid\FaGrid::widget(['columns' => $columns, 'dataUrl' => $dataUrl]);?>```