Yii Framework Forum: Chained Combobox - Yii Framework Forum

Jump to content

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

Chained Combobox Rate Topic: -----

#1 User is offline   leandrofranca 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 19-January 09
  • Location:Salvador, Bahia, Brasil

Posted 11 March 2009 - 10:17 AM

This post will continue other post in another session.

Quote

I have 3 dropDownLists (father, son, grandson) and I need to use ajax to fill each dropDown. I used this...



<?php Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl.'/assets/jquery.chainedSelects.js'); ?>




and



Quote

<?php Yii::app()->clientScript->registerScript('0', '$(function() { $(\'#country\').chainSelect(\'#'.CHtml::activeId($city,'state').'\',\'/imoveis/index.php/site/loadCombo\', { before:function (target) { $("#loading").css("display","block"); $(target).css("display","none"); }, after:function (target) { $("#loading").css("display","none"); $(target).css("display","inline"); } }); $(\'#'.CHtml::activeId($city,'state').'\').chainSelect(\'#'.CHtml::activeId($city,'city').'\',\''.Yii::app()->request->baseUrl.'/assets/combobox.php\', { before:function (target) { $("#loading").css("display","block"); $(target).css("display","none"); }, after:function (target) { $("#loading").css("display","none"); $(target).css("display","inline"); } }); });'); ?>




This works fine, but is too much code to do something relatively simple!

Basically what I need is some way to do exactly this whitout preoccupy with details how this will work in new or edit views.



Detail: ChainedSelects is one script jQuery to solve the problem of dependency, where we have more than 2 combobox.


Please, someone can help me to make this widget? ???
Script jQuery: http://codeassembly....gin-for-jQuery/
0

#2 User is offline   dalip 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 54
  • Joined: 21-December 08

Posted 11 March 2009 - 11:10 AM

I recently needed such a widget. It doesn't use the jQuery plugin but it works. I'll post it later today.
0

#3 User is offline   pmuruaga 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 31-December 08

Posted 31 May 2009 - 10:44 PM

Were you able to do it? I am needing this, please.
Or if not can you make some guide of how to do it in the way you make it work, please.
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