Skip to content

Instantly share code, notes, and snippets.

@melaniecarr23
Created September 9, 2016 03:03
Show Gist options
  • Save melaniecarr23/4a074c694cf265346b0e2f8312b93c9b to your computer and use it in GitHub Desktop.
Save melaniecarr23/4a074c694cf265346b0e2f8312b93c9b to your computer and use it in GitHub Desktop.
PHP: Yii2 kartik editable dropdown refresh after
// 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