diff --git a/src/resources/views/functions/batch_remove.blade.php b/src/resources/views/functions/batch_remove.blade.php new file mode 100644 index 0000000..192a7e5 --- /dev/null +++ b/src/resources/views/functions/batch_remove.blade.php @@ -0,0 +1,14 @@ +$(function(){ + @foreach($editors as $editor) + {{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s-{{$editor->instance}}"].on('preSubmit', function(e, data, action) { + if (action !== 'remove') return; + + for (let row_id of Object.keys(data.data)) + { + data.data[row_id] = { + DT_RowId: data.data[row_id].DT_RowId + }; + } + }); + @endforeach +});