Datatable icon indicating copy to clipboard operation
Datatable copied to clipboard

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

Open Javier-Rotelli opened this issue 10 years ago • 0 comments

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

Javier-Rotelli avatar Oct 16 '15 16:10 Javier-Rotelli