Skip to content

Commit c8a9ad9

Browse files
committed
Merge branch 'abdosaeedelhassan-master' into develop
2 parents a7623ca + a2c3289 commit c8a9ad9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ You can override any of these in your table component:
160160
| Property | Default | Usage |
161161
| -------- | ------- | ----- |
162162
| $searchEnabled | true | Whether or not searching is enabled |
163+
| $searchUpdateMethod | debounce | debounce or lazy |
163164
| $searchDebounce | 350 | Amount of time in ms to wait to send the search query and refresh the table |
164165
| $disableSearchOnLoading | true | Whether or not to disable the search bar when it is searching/loading new data |
165166
| $search | *none* | The initial search string |

resources/views/includes/_options.blade.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
@if ($searchEnabled)
2222
<div class="col">
2323
<input
24-
@if (is_numeric($searchDebounce)) wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
24+
@if (is_numeric($searchDebounce) && $searchUpdateMethod === 'debounce') wire:model.debounce.{{ $searchDebounce }}ms="search" @endif
25+
@if ($searchUpdateMethod === 'lazy') wire:model.lazy="search" @endif
2526
@if ($disableSearchOnLoading) wire:loading.attr="disabled" @endif
2627
class="form-control"
2728
type="text"

src/Traits/Search.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ trait Search
1111
* Search.
1212
*/
1313

14+
/**
15+
* Method to search by: debounce or lazy
16+
* @var string
17+
*/
18+
public $searchUpdateMethod = 'debounce';
19+
1420
/**
1521
* Whether or not searching is enabled.
1622
*

0 commit comments

Comments
 (0)