Dependent dropdownlist problem with jqrelcopy

Hi,

I have four dropdownlist say parameter, condition, condition parameter and concatoperator as in the attachment. Here condition parameter depends on parameter dropdownlist. When i click on Add all the four are replicated (here i use jqrelcopy extension) the parameter shows all the values but the condition parameter shows the same values as in the first.i.e there is no dependency.

view code




<td>

	

		<?php echo $form->labelEx($parameter,'parameter_id'); ?>

		<?php echo $form->dropDownList($parameter,'parameter_id[]', CHtml::listData(Parameters::model()->findAll(array('order'=>'parameter_name','condition'=>'Module_List_id=1')),'parameter_id','parameter_name'),array('empty'=>'--please select--',

						'ajax'=>array(

							'type'=>'POST',

							'url'=>CController::createUrl('RuleList/dynamicvalues'),

							'update'=>'#'.CHtml::activeId($model1,'parameter2[]')

							)       

						));

			  

		<?php echo $form->error($parameter,'parameter_id'); ?>


	</td>



controller code




public function actionDynamicvalues($i=0)

	{

		

		$parameter_id=$_POST['Parameters']['parameter_id'][((int)$i)];

		$data=ConditionParameter::model()->findAll('parameter_id=:parameter_id', 

                  array(':parameter_id'=>$parameter_id));

		$data=CHtml::listData($data,'cond_parameter_id','cond_parameter');

		foreach($data as $value=>$cond_parameter)  

		{

                echo CHtml::tag('option',array('value'=>CHtml::encode($cond_parameter)),CHtml::encode($cond_parameter),true);

		}

		

	}



I tried many ways but no solution.

Please help me.

Is it that only first time the method dynamicvalues is called and is not when replicated?? Please any suggestions…

Is it possible to perform the method action in the form itself. This might solve my problem.

Please guide me.

Did you get solution on this, I having same issue…Please Help.

I have the same problem (using the MultiModelForm extension) but the solution according to its author Joblo lies in modifying the jqrelcopy script to modify the id’s of the cloned lines - I don’t know enough JavaScript to do that yet. Any help is welcome.

Thanks,