Skip to content

Setting Up responseCallback. #2777

@Nuhel

Description

@Nuhel

How to set responseCallback in datatable class . I saw there is a function named 'response' to set this, but i am confused from where to call this. So I override render function and called inside it. My code is attached below

public function render($view, $data = [], $mergeData = [])
    {
        $this->response(function($data){
            return ($this->makeResponse($data->toArray()));
        });
        return parent::render($view,$data,$mergeData);
    }

System details

  • Operating System: MacOs
  • PHP Version: 8.0..12
  • Laravel Version 8.75
  • "yajra/laravel-datatables": "^1.5",
    "yajra/laravel-datatables-buttons": "^4.0",
    "yajra/laravel-datatables-editor": "^1.0",
    "yajra/laravel-datatables-oracle": "^9.19"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions