nterms / yii2-pagesize-widget

Widget for enabling dynamic page size selection on yii2 GridView
MIT License
38 stars 18 forks source link

Not working if pageSizeParam is array #11

Closed honsa closed 5 years ago

honsa commented 5 years ago

Hello

Thank you for this nice little plugin.

It seems working fine to set the pageSize, except the actual perPage set of the dropdownList does not work if pageSizeParam is an array like

'pageSizeParam' => 'ModelSearch[per-page]'

Instead of the selected pageSize the default value is used cause the name is not found in the $_GET data.

nterms commented 5 years ago

@honsa thanks for reporting this. However, arrays can go into multiple nested levels and supporting them could be complicated. If you already have a solution please send a pull request.

honsa commented 5 years ago

Thank you for your fast reply ;)

This is not a big problem, i just tried it with a recursive function and it is working for me. May its not bullet proof already but a good start and stable enough:

https://github.com/nterms/yii2-pagesize-widget/pull/12