How to use editor datatables in laravel with mysql ?

How to use editor datatables in laravel with mysql ?

Phoenix7sPhoenix7s Posts: 3Questions: 2Answers: 0

I am developing an application in which I process MySQL data with datatables I use yajra-data tables. To perform operations such as update, deletion and selection I use this approach:

...
 return DataTables::of($data)
            ->addColumn('modifier', function ($data) {
                return '<a href="#" class="btn btn-xs btn-warning Modifier" id="' . $data->id . '"><i class="material-icons">edit</i></a>';
            })
            ->addColumn('supprimer', function ($sup) {
                return '<a href="#" class="btn btn-xs btn-danger Supprimer" id="' . $sup->id . '"><i class="material-icons">delete</i></a>';
            })
            ->addColumn('check', function ($check) {
                return '<input type="checkbox" name="selected_materiels[]" class="check" id="' . $check->id . ' value="' . $check->id . '">';
            })
            ->rawColumns(['modifier', 'supprimer', 'check'])
            ->make(true);

But recently, I came across this datatables editor https://editor.datatables.net/ which can perform these operations inside the API, I need a complete working example using MySQL to understand how I can adapt it to my current application, thanks in advance.

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    I'm not familiar with Laravel, but it would be worth searching this forum for other suggestions, such as this thread here.

    Colin

  • Phoenix7sPhoenix7s Posts: 3Questions: 2Answers: 0

    @Colin, thank you very much, I will try it.

This discussion has been closed.