Gridview 选择2在筛选YII2后继续加载
谢谢你的阅读。我对select2-filter gridview Yii2有一些问题: Yii2加载页面时选择render select2: 因此它工作正常,数据已填充,但选择2保持显示加载图标: 这是我的代码,请在“名称”列中选择2Gridview 选择2在筛选YII2后继续加载,gridview,yii2,jquery-select2,Gridview,Yii2,Jquery Select2,谢谢你的阅读。我对select2-filter gridview Yii2有一些问题: Yii2加载页面时选择render select2: 因此它工作正常,数据已填充,但选择2保持显示加载图标: 这是我的代码,请在“名称”列中选择2 希望您能提供帮助:)试试这个: [ 'attribute' => 'name', 'value' => \yii\helpers\ArrayHelper::map(\common\models\Catnew::find()-&
希望您能提供帮助:)试试这个:
[
'attribute' => 'name',
'value' => \yii\helpers\ArrayHelper::map(\common\models\Catnew::find()->all(), 'name', 'name'),
'filterType' => GridView::FILTER_SELECT2,
'filter' =>\yii\helpers\ArrayHelper::map(\common\models\Catnew::find()->all(), 'name', 'name'),
'filterWidgetOptions' => [
'pluginOptions' => ['allowClear' => true],
],
'filterInputOptions' => ['placeholder' => '...'],
'format' => 'raw'
],
“pjax”=>true更改为false
干得好我正在使用网格视图,我在其中放置了
['attribute'=>'Sub\u Division\u Name','filter'=>Select2::widget(['data'=>\yii\helpers\ArrayHelper::map(\common\models\surveyhescousubdivision::find()->all(),'id','Name')),“名称”=>“子分区名称”,“选项”=>[“占位符”=>“子分区名称”,],“主题”=>Select2::theme\u默认值,“插件选项”=>[“allowClear”=>true,],],],,,,,,,,,,,,,
[
'attribute' => 'name',
'value' => \yii\helpers\ArrayHelper::map(\common\models\Catnew::find()->all(), 'name', 'name'),
'filterType' => GridView::FILTER_SELECT2,
'filter' =>\yii\helpers\ArrayHelper::map(\common\models\Catnew::find()->all(), 'name', 'name'),
'filterWidgetOptions' => [
'pluginOptions' => ['allowClear' => true],
],
'filterInputOptions' => ['placeholder' => '...'],
'format' => 'raw'
],