Chained Combobox

This post will continue other post in another session.


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'); ?>



<?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/

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

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.