Filtering dropdown contents by other dropdown selections

Hi folks!

In Yii2 I’ve got a Customers view that has filters for Region, Branch and Salesperson. When I choose a Region, I need the Branch and Salespeople filter dropdowns in the header of my gridview to get filtered by my Region selection. Similarly, when I choose a Salesperson, I need the Branches and Region to filter by that Salesperson.

So my question is, is it possible to have the filter dropdowns be filtered by my selections in all other filter dropdowns? This is just vanilla Yii2 Advanced Template with no Kartik widgets or anything. I’d prefer not to install any other dependencies if it can be done without them.

Thanks in advance!

Google for how to have associated dropdowns on a form and it should be easy to modify to the filter dropdowns. You will need to involve AJAX/PJAX requests for the updating of the lists in the other dropdowns.

Hi,

This link may help you!

http://www.yiiframework.com/wiki/723/creating-a-dependent-dropdown-from-scratch-in-yii2/