yii2-toggle-column icon indicating copy to clipboard operation
yii2-toggle-column copied to clipboard

Unknown Method was thrown !

Open deshario opened this issue 7 years ago • 1 comments

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()
                    ]
                ],
            ],

unknow

deshario avatar Dec 24 '17 08:12 deshario

Just in case. for others. you forgot to add "use \dixonstarter\togglecolumn\ToggleActionTrait;" before function getToggleItems()

zhandos38 avatar Oct 05 '19 10:10 zhandos38