Yii Framework Forum: Filtering dropdown contents by other dropdown selections - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Filtering dropdown contents by other dropdown selections

#1 User is offline   Zefrem23 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 01-November 17

Posted 01 November 2017 - 12:51 PM

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!
0

#2 User is offline   jkofsky 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 687
  • Joined: 17-May 10
  • Location:Pensacola, Florida

Posted 02 November 2017 - 02:39 PM

View PostZefrem23, on 01 November 2017 - 12:51 PM, said:

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.
Do, or do not. There is no 'try.' Jedi Master Yoda
1

#3 User is offline   Arockia Johnson SR 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 185
  • Joined: 25-June 13
  • Location:Singapore

Posted 09 November 2017 - 04:34 AM

Hi,

This link may help you!

http://www.yiiframew...cratch-in-yii2/

மகிழ்ச்சியாக குறியிடுங்கள்!..... Happy Coding!.....


Thanks & Regards,
ஜான்சன் ( Arockia Johnson SR )
www.arojohnson.tk

Hit (+) button If my replies really helped you!
1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users