Skip to content

Commit 2d0c957

Browse files
authored
Merge pull request #212 from frknakk/master
feat: add batch remove optimization script (optional)
2 parents 2d7e73c + e02253a commit 2d0c957

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
$(function(){
2+
@foreach($editors as $editor)
3+
{{ config('datatables-html.namespace', 'LaravelDataTables') }}["%1$s-{{$editor->instance}}"].on('preSubmit', function(e, data, action) {
4+
if (action !== 'remove') return;
5+
6+
for (let row_id of Object.keys(data.data))
7+
{
8+
data.data[row_id] = {
9+
DT_RowId: data.data[row_id].DT_RowId
10+
};
11+
}
12+
});
13+
@endforeach
14+
});

0 commit comments

Comments
 (0)