Closed mirko-pagliai closed 9 years ago
It would have to sort the entire array in memory, wouldn't it?
As with any other operation using ArraySource
I asked a question on StackOverflow, where I reported some information. Try to take a look: http://stackoverflow.com/questions/20972374/cakephp-arraysource-paginator
The "limit" condition works correctly. Even the paging works correctly: if I set the limit of records to be displayed and if I move between pages, I see the correct records (in the example, setting the limit of 2 records, on the first page I see the first two, the other two on the second page).
But if I click on a "sort()" link, there is no effect, I view the records in the original order. Even if I set the "order" condition in the pagination settings, the records are always shown in original order.
@mirko-pagliai It's likely that ordering of records isn't implemented in the array source. The datasources in this repo are community maintained. So if you find a bug or need enhancement the best way would be to provide a patch (pull request) yourself.
Sure, I know that. I just wanted to know if I'm doing something wrong or if the sorting is not supported ;-)
Fixed here: https://github.com/cakephp/datasources/pull/113
Nice!
This is not a real issue, this is rather a question. The plugin - and in particular the ArraySource datasource, supports the sorting provided by the Paginator component?
Using the Paginator component with ArraySource, I see that the paging works correctly, but not the sort (does not work nor the default sort, nor the sort specified by the user clicking on a sort link).