Skip to content

Commit

Permalink
Merge pull request #5674 from Laravel-Backpack/add-search-debounce-to…
Browse files Browse the repository at this point in the history
…-datatables

add searchDelay option to datatables search
  • Loading branch information
pxpm committed Sep 20, 2024
2 parents ec93885 + 2d5e69b commit 3714d7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config/backpack/operations/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
// show search bar in the top-right corner?
'searchableTable' => true,

// how much time should the system wait before triggering the search function after the user stops typing?
'searchDelay' => 400,

// the time the table will be persisted in minutes
// after this the table info is cleared from localStorage.
// use false to never force localStorage clear. (default)
Expand Down
1 change: 1 addition & 0 deletions src/resources/views/crud/inc/datatables_logic.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ functionsToRunOnDataTablesDrawEvent: [],
},
processing: true,
serverSide: true,
searchDelay: {{ $crud->getOperationSetting('searchDelay') }},
@if($crud->getOperationSetting('showEntryCount') === false)
pagingType: "simple",
@endif
Expand Down

0 comments on commit 3714d7d

Please sign in to comment.