yajra / laravel-datatables

jQuery DataTables API for Laravel
https://yajrabox.com/docs/laravel-datatables
MIT License
4.75k stars 861 forks source link

Add skip total records back #3170

Closed JurianArie closed 1 month ago

JurianArie commented 1 month ago

This PR undoes the deprecation of skipTotalRecords and restores the working of setTotalRecords(0) back to how it was in v10.4.3.

Alternative to #3169. Partially reverts #3157.

OzanKurt commented 1 month ago

I think bringing "skip" back is a great idea!

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

yajra commented 1 month ago

Looks good to go for me. Do you approve of this @OzanKurt?

OzanKurt commented 1 month ago

My use case: (working)

I set my total records and it doesn't count them.

$dataTable->setTotalRecords($kpiValues['total_count']);

Case 1 • No Filtering

image

Case 2 • With Filtering

image

Jurian's use case: (working)

$dataTable->skipTotalRecords();

Case 1 • No Filtering

image

Case 2 • With Filtering

image


I think we have it now! 😊


Warning!

This might be a breaking change for people who is using setTotalRecords(0) instead of skipTotalRecords.

yajra commented 1 month ago

Released on https://github.com/yajra/laravel-datatables/releases/tag/v11.1.5 🚀 Thanks!