Created
September 9, 2016 03:03
-
-
Save melaniecarr23/4a074c694cf265346b0e2f8312b93c9b to your computer and use it in GitHub Desktop.
PHP: Yii2 kartik editable dropdown refresh after
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// status dropdown editable column | |
[ | |
'class' => 'kartik\grid\EditableColumn', | |
'attribute' => 'appt_statusID', | |
'refreshGrid' => true, | |
'pageSummary' => true, | |
'width' => '100px', | |
// filtering grid | |
'filterType'=>GridView::FILTER_SELECT2, | |
'filter'=>ArrayHelper::map(ApptStatus::find()->orderBy('ID')->asArray()->all(), 'ID', 'appointment_status'), | |
'filterWidgetOptions'=>[ | |
'pluginOptions'=>['allowClear'=>true], | |
], | |
'filterInputOptions'=>['placeholder'=>'- Status -'], | |
// end filtering grid | |
'editableOptions'=> function ($model, $key, $index, $widget) { | |
$status = ArrayHelper::map(ApptStatus::find()->orderBy('ID')->asArray()->all(),'ID','appointment_status'); | |
return [ | |
'header' => 'Status', | |
'size' => 'sm', | |
'attribute' => 'appt_statusID', | |
'inputType' => 'dropDownList', | |
'displayValueConfig' => $status, | |
'data' => $status | |
]; | |
} | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment