Grids
Grids copied to clipboard
get error "ErrorException" when use "$val, ObjectDataRow $row" in setCallback
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

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
})
thank you. my problem sloved :)