0
我想添加一個DropDownList GridView的,我做到了在過濾器包括GridView的那樣:的DropDownList的GridView的yii2
,但我想這樣做的GridView外面像
請別人幫我!!!
我想添加一個DropDownList GridView的,我做到了在過濾器包括GridView的那樣:的DropDownList的GridView的yii2
,但我想這樣做的GridView外面像
請別人幫我!!!
<?=
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'toolbar' => [
['content' =>
Html::dropDownList('name', 'null', ['1' => 'Bulan ini', '2' => 'Bulan Lepas', '3' => 'Tahun ini', '4' => 'Tahun Lepas'], ['id' => 'gs1', 'class' => 'form-control'])
],
'{export}',
'{toggleData}',
],
'panel' => [
'type' => GridView::TYPE_PRIMARY,
'heading' => $this->title,
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'ID',
.....,
],
]);
?>
<?=
GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'toolbar' => [
['content' =>
Html::dropDownList('name', 'null', ['1' => 'Bulan ini', '2' => 'Bulan Lepas', '3' => 'Tahun ini', '4' => 'Tahun Lepas'], ['id' => 'gs1', 'class' => 'form-control'])
],
'{export}',
'{toggleData}',
],
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'ID',
.....,
],
]);
?>
限定面板I如果沒有,你不能看到你的下拉列表。 –
但是當我可以定義類常量'TYPE_PRIMARY',因爲我得到錯誤'未定義的類常量'TYPE_PRIMARY'' –
它的工作,謝謝 –