dropdown in japoendo

hi,

I was trying to add a dependatn dropdown in jappendo.

The following is my code for it. But i got an error saying :

Fatal error: Call to a member function DropDownList() on a non-object in G:\xampp\htdocs\testyii\damodar\protected\extensions\appendo\views\enumerations.php on line 17

Can anybody tell me where the error is and help me correct it?


<td><?php


			 $productCategoriesArray = CHtml::listData(ProductsCategory::model()->findAll(),'primaryKey','cat_name');  

                   echo $form->DropDownList($model,'cat_id',$productCategoriesArray,  

                            array(

							'prompt'=>'Select category...',   

                                'ajax' => array(  

                                'type'=>'POST',  

                                'url'=>CController::createUrl('Products/dynamicSubcategory'),  

                                'update'=>'#'.CHtml::activeId($model,'subcat_id')

								)));  

  


 

                 ?> 

                <?php echo $form->error($model,'cat_id'); ?> 

            

             <?php  //


 

                  ?>

                   <?php /*echo CHtml::dropDownList('subcat_id[]',"string",

                array(

                   

                ),array('style'=>'width:100px')

                );*/

            ?>

            </td>

Thanks

You are using CActiveForm syntax:


$form->DropDownList(...

What is $form? Did you initialize it?

i changed


$form->DropDownList(...

to


CHtml::listData(

. That error is gone but now its giving an exception :JAppendo does not have a method named "getModule".

What to do?

Hi initialised it to


$form=$this->beginWidget('CActiveForm', array(

	'id'=>'form',

	'enableAjaxValidation'=>false,

));

but now i am getting an exception :JAppendo does not have a method named "getModule".

Can u please suggest what needs to be done.

Thanks

I am not sure it will solve, but create the url like that:


url'=>array('Products/dynamicSubcategory'),

hi zac… tried that. now its not showing that error but is not updating the other dropdown too.i think the control does not reach the function "dynamicSubcategory"…

You can check that with firefox / firebug to see the return value of the ajax call…

Check that you added the dynamicSubcategory to accessRules() as allowed

but is it possible to use dependent dropdown in jappendo??

i want to ask about the extentions of jQuery, especially in Yii framework. i got some stuck on this code :


jQuery("#repeateEnum").appendo is not a function

this code is triggered from both of this code :


<table class="appendo-gii" id="<?php echo $id ?>"> <thead> <tr> </tr> </thead>


 <?php $this->widget('application.extensions.appendo.JAppendo',array( 'id' => 'repeateEnum', 'model' => $model,.. ?>

besides, i think there’s something wrong at code :


 'id'=>'repeateEnum' 

.

It helps when the Id was auto_increment, but it doesn’t work at else.

Could you give a solution for this case?

Thanks a lot