Skip to content

Commit 3714d7d

Browse files
authored
Merge pull request #5674 from Laravel-Backpack/add-search-debounce-to-datatables
add searchDelay option to datatables search
2 parents ec93885 + 2d5e69b commit 3714d7d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/config/backpack/operations/list.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
// show search bar in the top-right corner?
2323
'searchableTable' => true,
2424

25+
// how much time should the system wait before triggering the search function after the user stops typing?
26+
'searchDelay' => 400,
27+
2528
// the time the table will be persisted in minutes
2629
// after this the table info is cleared from localStorage.
2730
// use false to never force localStorage clear. (default)

src/resources/views/crud/inc/datatables_logic.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ functionsToRunOnDataTablesDrawEvent: [],
261261
},
262262
processing: true,
263263
serverSide: true,
264+
searchDelay: {{ $crud->getOperationSetting('searchDelay') }},
264265
@if($crud->getOperationSetting('showEntryCount') === false)
265266
pagingType: "simple",
266267
@endif

0 commit comments

Comments
 (0)