Chumper / Datatable

This is a laravel 4 package for the server and client side of datatables at http://datatables.net/
https://github.com/Chumper/Datatable
388 stars 154 forks source link

Collection engine skips the last row when using bPaginate => false #346

Open Javier-Rotelli opened 9 years ago

Javier-Rotelli commented 9 years ago

if you turn off bPaginate (->setOptions(['bPaginate'=>false]); the collection engine will skip the las row in the collection.

this is because when pagination is off, datables will pass the parameter iDisplayLength with a value of -1 wich then gets passed to the engine, resulting in a slice of the collection removing the last item. here https://github.com/Chumper/Datatable/blob/master/src/Chumper/Datatable/Engines/CollectionEngine.php#L81 and here https://github.com/Chumper/Datatable/blob/master/src/Chumper/Datatable/Engines/CollectionEngine.php#L137

I'm working on it, i have a failing test for this bug, and a solution, but before I do a pull request i'd like to fix #341