Yii2 GridView sorting breaks multi-select filter

Hello

I implemented a multi-select filter in yii2 grid. Filtering and sorting separately works. Also filters and sorting with non-multi-select filters works. When I use a multi-select filter and use sorting afterwards, the URL gets somehow corrupted.

The problem has already been described by an other user here:

He also posted a workaround. However, I’d like to ask if there’s someone else with this problem? Or have I done something wrong?

Any ideas?

The problem is due to pjax. My recommendation is to not use PJax Widget when using those complex widgets for filtering OR instead of that you could:

  • create your very own URL override function using PJax events (ie pjax:complete)

  • create a search widget separated from the GRID, remove the FILTER ROW from the Grid view and when clicking the button make a call to an AJAX your self to render the new grid avoiding the use of PJax completely (you will have to capture paging and sorting links too on your javascript)

Thx for the response.

I am overriding the URL now.

Maybe I will replace pjax later on. Currently, it’s not very fast.