File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,35 @@ public function keepSelectBindings(): static
205205 return $ this ;
206206 }
207207
208+ /**
209+ * Perform column search.
210+ *
211+ * @return void
212+ */
213+ protected function filterRecords (): void
214+ {
215+ $ initialQuery = clone $ this ->query ;
216+
217+ if ($ this ->autoFilter && $ this ->request ->isSearchable ()) {
218+ $ this ->filtering ();
219+ }
220+
221+ if (is_callable ($ this ->filterCallback )) {
222+ call_user_func ($ this ->filterCallback , $ this ->resolveCallbackParameter ());
223+ }
224+
225+ $ this ->columnSearch ();
226+ $ this ->searchPanesSearch ();
227+
228+ // If no modification between the original query and the filtered one has been made
229+ // the filteredRecords equals the totalRecords
230+ if ($ this ->query == $ initialQuery ) {
231+ $ this ->filteredRecords ??= $ this ->totalRecords ;
232+ } else {
233+ $ this ->filteredCount ();
234+ }
235+ }
236+
208237 /**
209238 * Perform column search.
210239 *
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function it_can_set_total_records()
2525 $ crawler ->assertJson ([
2626 'draw ' => 0 ,
2727 'recordsTotal ' => 10 ,
28- 'recordsFiltered ' => 20 ,
28+ 'recordsFiltered ' => 10 ,
2929 ]);
3030 }
3131
@@ -36,7 +36,7 @@ public function it_can_set_zero_total_records()
3636 $ crawler ->assertJson ([
3737 'draw ' => 0 ,
3838 'recordsTotal ' => 0 ,
39- 'recordsFiltered ' => 20 ,
39+ 'recordsFiltered ' => 0 ,
4040 ]);
4141 }
4242
You can’t perform that action at this time.
0 commit comments