Yii Framework Forum: Dependant List Boxes - Yii Framework Forum

Jump to content

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

Dependant List Boxes Rate Topic: -----

#1 User is offline   Dallas G 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-March 10

Posted 13 April 2010 - 09:17 AM

Hi,

I would like to have a form with 2 listboxes each containing a list of suburbs.
but i would like the first to show suburbs that arent assigned to a user and the second to show the suburbs assigned to the user, eg mutually exclusive.

is it possible to use ajax to do this ? so that when its saved only the user table is updated

the form is used to manage users, for the user table, i have a suburb table and a usersuburb table
0

#2 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 13 April 2010 - 01:58 PM

If your asking for a built-in implementation that does that, There is none. To do what you just described you will need to perform two queries and have one array that holds the suburbs that are not assigned to the user and the other that are assigned to a user. You can of course use Ajax to do that by using the $.ajax method.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#3 User is offline   Dallas G 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-March 10

Posted 14 April 2010 - 12:51 AM

thanks, i was thinking of having the 2 on a separate form, and loading them, then each listbox having a ajaxsubmitbutton that can update each list depending in the changes

$.ajax functions? is this the built in jquery library?
0

#4 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 14 April 2010 - 02:24 AM

Yes. Though if you will try to use CHtml::ajaxButton in a content that is loaded via ajax that won't work. see: http://www.yiiframew...-in-load-forms/
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#5 User is offline   Dallas G 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-March 10

Posted 14 April 2010 - 07:24 AM

thanks, will look there.
0

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