Closed Benoit75 closed 4 years ago
Well here seems to be the problem : 1) We need to load the select plugin (cf https://datatables.net/download/) @yajra i can't find why it does not load with others plugin? 2) in builder set select @ true 3) in builder set the row id (https://datatables.net/manual/tech-notes/14)
So our code is now
views/layouts/app.blade.php, just before < /head>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css"/>
</head>
views/layouts/app.blade.php, just before < /body>
<script type="text/javascript" src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.js"></script>
@stack('scripts')
</body>
app/DataTables/UsersDataTable.php
return $this->builder()
->setTableId('users-table')
->columns($this->getColumns())
->minifiedAjax()
->dom('Bfrtip')
// ---------------------------------------------
->select(true)
//---------------------------------------------
->orderBy(1)
->buttons(
Button::make('create')->editor('editor'),
Button::make('edit')->editor('editor'),
Button::make('remove')->editor('editor'),
Button::make('export'),
Button::make('print'),
Button::make('reset'),
Button::make('reload')
)
->editor(
Editor::make()
->fields([
Fields\Text::make('name'),
Fields\Text::make('email'),
Fields\Password::make('password'),
])
//---------------------------------------------
->idSrc(['id'])
//---------------------------------------------
);
Enjoy !
@yajra said in [https://github.com/yajra/laravel-datatables-buttons/issues/101] datatables.net-select-bs4 was missing ! Work's fine know
Summary of problem or feature request
Hello This issue is following https://github.com/yajra/laravel-datatables-buttons/issues/101 (i can't reopen it)
On a fresh install following yajra/Datatables Quick starter (ok) and Editor/Tutorial. There is a JS error :
Uncaught Cannot extend unknown button type: selected
The error is generate by two editor button in UsersDatatables.php
Any thought ? Thank's