Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown Method was thrown ! #3

Open
deshario opened this issue Dec 24, 2017 · 1 comment
Open

Unknown Method was thrown ! #3

deshario opened this issue Dec 24, 2017 · 1 comment

Comments

@deshario
Copy link

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

@zhandos38
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants