leantony / laravel-grid

A grid view for laravel, inspired by the yii2 grid widget
https://leantony.github.io/laravel-grid/
MIT License
91 stars 39 forks source link

create customised row button issue #108

Open SwathySunilKumar opened 5 years ago

SwathySunilKumar commented 5 years ago

the code I used for creating the button is:

$this->makeCustomButton([
            'name' => 'home',
            'url' => url('/'),
        ], 'rows');

and the error I received:

Method App\Grids\FoodCategoriesGrid::__toString() must not throw an exception, caught ErrorException: call_user_func() expects parameter 1 to be a valid callback, no array or string given (View: /var/www/html/kot/resources/views/vendor/leantony/grid/grid.blade.php)

Could someone help me find a solution for the above.

ahmad-samir commented 4 years ago

the code I used for creating the button is:

$this->makeCustomButton([
            'name' => 'home',
            'url' => url('/'),
        ], 'rows');

and the error I received:

Method App\Grids\FoodCategoriesGrid::__toString() must not throw an exception, caught ErrorException: call_user_func() expects parameter 1 to be a valid callback, no array or string given (View: /var/www/html/kot/resources/views/vendor/leantony/grid/grid.blade.php)

Could someone help me find a solution for the above.

you should call like this:

$this->makeCustomButton([ 'name' => 'home', 'url' => url('/'), ], 'rows')->render([ 'gridName'=>$this->name, 'gridItem'=>$this, ]);