You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see the default pageSize set to ArrayDataProvider is 10. The GridView rendered is the following:
If someone clicks the Grid Configuration options and change the page size from 10 to 5, he would expect the items per page to be reduced at 5.
However the rows per page stay the same, i.e. the new configuration value is never applied.
Possible Solution:
After some research on the DynaGrid class I found that getAttributeLabel() method is forcing ArrayDataProvider to populate its models before the new Pagination object is applied, i.e.
The problem:
Suppose that you have the following code:
As you can see the default
pageSize
set toArrayDataProvider
is 10. The GridView rendered is the following:If someone clicks the Grid Configuration options and change the page size from 10 to 5, he would expect the items per page to be reduced at 5.
However the rows per page stay the same, i.e. the new configuration value is never applied.
Possible Solution:
After some research on the
DynaGrid
class I found thatgetAttributeLabel()
method is forcingArrayDataProvider
to populate its models before the newPagination
object is applied, i.e.A possible fix could be to invalidate the provider's contents by calling refresh(), i.e.
I can provide a PR for the above fix, or you may come up with a more elegant solution.
The text was updated successfully, but these errors were encountered: