Skip to content

Commit 721267b

Browse files
authored
Merge pull request yajra#22 from forgottencreature/filtered-count
Add link to setFilteredRecords documentation.
2 parents f671100 + de544b7 commit 721267b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
- [Blacklist Columns](/docs/{{package}}/{{version}}/blacklist)
5454
- [Whitelist Columns](/docs/{{package}}/{{version}}/whitelist)
5555
- [Set Total Records](/docs/{{package}}/{{version}}/set-total-records)
56+
- [Set Filtered Records](/docs/{{package}}/{{version}}/set-filtered-records)
5657
- [Skip Paging](/docs/{{package}}/{{version}}/skip-paging)
5758

5859
### PLUGINS

set-filtered-records.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Set Filtered Records
2+
3+
In some cases, we need to manually set the filtered records count of our `DataTables` and skip its internal counting functionality.
4+
To achieve this, we can use `setFilteredRecords($count)` api.
5+
6+
```php
7+
use DataTables;
8+
9+
Route::get('user-data', function() {
10+
$model = App\User::query();
11+
12+
return DataTables::eloquent($model)
13+
->setFilteredRecords(100)
14+
->toJson();
15+
});
16+
```

0 commit comments

Comments
 (0)