Grids icon indicating copy to clipboard operation
Grids copied to clipboard

get error "ErrorException" when use "$val, ObjectDataRow $row" in setCallback

Open nekooee opened this issue 7 years ago • 2 comments

hi I use $val, ObjectDataRow $row for get row id and delete or edit row. but get this error: (1/1) ErrorException Argument 2 passed to App\Http\Controllers\Front\IndexController::App\Http\Controllers\Front{closure}() must be an instance of App\Http\Controllers\Front\ObjectDataRow, instance of Nayjest\Grids\EloquentDataRow given

please help me.

nekooee avatar Oct 24 '17 06:10 nekooee

remember to

use Nayjest\Grids\ObjectDataRow;

then

->setCallback(function ($val, ObjectDataRow $dr) {
         // value of the cell
        // $val 

         // all data row
         // $data= $dr->getSrc(); 

        // row id
         $id= $dr->getId();
         return $id
})

wdog avatar Oct 24 '17 07:10 wdog

thank you. my problem sloved :)

nekooee avatar Oct 24 '17 12:10 nekooee