apollo/yii2-xeditable

Yii2 X-editable试用版

dev-master 2020-12-10 13:28 UTC

This package is not auto-updated.

Last update: 2024-09-24 05:36:03 UTC


README

# Yii2 X-editable试用版。仅提供基本功能。不稳定。使用方法

 echo GridView::widget([
 .....
 'columns' => [
 ......
 [
                     'value'=>function($data) {

                             if(empty($data->is_active))
                             {
                                 return Yii::t('app','No');
                             }

                             return Yii::t('app','Yes');
                         },
                     'class' => \Apollo\EditableColumn::className(),
                     'dataType'=>'select',
                     'url'=>Yii::$app->urlManager->createUrl('/users/changeStatus'),
                     'editable'=>[

                         'source'=>[
                             ['value'=>1,
                             'text'=>Yii::t('app','Yes')],
                             ['value'=>0,
                             'text'=>Yii::t('app','No')]
                         ],

                     ],

                     'attribute' => 'is_active',
                     'format' => 'raw',
                     'filter' => ['1' => Yii::t('app', 'Yes'),'0' => Yii::t('app', 'No'),],

                 ],
                 .....
                 ]
                 .....
                 ]);