Open deshario opened 6 years ago
I am not sure that what's missing ... how to fix it
Calling unknown method: app\models\UserSearch::getItemFilter()
Model
public function getToggleItems() { // custom array for toggle update return [ 'on' => ['value'=>1, 'label'=>'Publish'], 'off' => ['value'=>0, 'label'=>'Panding'], ]; }
Gridview
[ 'attribute'=>'status', 'class'=>'\dixonstarter\togglecolumn\ToggleColumn', 'options'=>['style'=>'width:50px;'], 'linkTemplateOn'=>'<a class="toggle-column" data-pjax="0" href="{url}">{label}</a>', 'linkTemplateOff'=>'<a class="toggle-column" data-pjax="0" href="{url}">{label}</a>' ],
Controller
'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['POST'], 'toggle-update'=>[ 'class'=>'\dixonstarter\togglecolumn\actions\ToggleAction', 'modelClass'=>User::className() ] ], ],
Just in case. for others. you forgot to add "use \dixonstarter\togglecolumn\ToggleActionTrait;" before function getToggleItems()
I am not sure that what's missing ... how to fix it
Model
Gridview
Controller