mithila
(Mithila)
May 6, 2011, 5:20am
1
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
mdomba
(Maurizio Domba Cerin)
May 6, 2011, 6:19am
2
You are using CActiveForm syntax:
$form->DropDownList(...
What is $form? Did you initialize it?
mithila
(Mithila)
May 6, 2011, 6:46am
3
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?
mithila
(Mithila)
May 6, 2011, 6:55am
4
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
zaccaria
(Matteo Falsitta)
May 6, 2011, 8:21am
5
I am not sure it will solve, but create the url like that:
url'=>array('Products/dynamicSubcategory'),
mithila
(Mithila)
May 17, 2011, 4:48am
6
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"…
mdomba
(Maurizio Domba Cerin)
May 17, 2011, 6:05am
7
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
mithila
(Mithila)
May 17, 2011, 6:13am
8
but is it possible to use dependent dropdown in jappendo??
mbaksri
(Dbor Zip)
February 6, 2012, 8:39am
9
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