File tree 2 files changed +31
-2
lines changed
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
205
205
return $ this ;
206
206
}
207
207
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
+
208
237
/**
209
238
* Perform column search.
210
239
*
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function it_can_set_total_records()
25
25
$ crawler ->assertJson ([
26
26
'draw ' => 0 ,
27
27
'recordsTotal ' => 10 ,
28
- 'recordsFiltered ' => 20 ,
28
+ 'recordsFiltered ' => 10 ,
29
29
]);
30
30
}
31
31
@@ -36,7 +36,7 @@ public function it_can_set_zero_total_records()
36
36
$ crawler ->assertJson ([
37
37
'draw ' => 0 ,
38
38
'recordsTotal ' => 0 ,
39
- 'recordsFiltered ' => 20 ,
39
+ 'recordsFiltered ' => 0 ,
40
40
]);
41
41
}
42
42
You can’t perform that action at this time.
0 commit comments