Hi, I am using the auto complete on a tabular input form. It is perfectly working on the main form, when i call the child form like this the auto complete is not working at all. What i am doing wrong. Any help or suggestion is really appreciated.
Yii::app()->clientScript->registerScript('vctranRow', "var lastTran = 0,a=1 ;
var trTran = new String(" .
CJSON::encode($this->renderPartial('form/_vctranRow', array('id' => 'idVcr', 'model' => new VcTran, 'form' => $form, 'this' => $this), true, false)) .
");
function addTran(button)
{
lastTran++; a++
button.parents('table').children('tbody').append(trTran.replace(/idRep/g, lastTran));
}
function deleteTran(button)
{
button.parents('tr').detach();
}
");
_vctranRow.php
<tr>
<td>
<?php echo $form->textField($model, "[$id]vc_dr_type",array('size' => 2, 'maxlength' => 2)); ?>
</td>
<td>
<?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'model'=>$model,
'attribute'=>'vc_dr_ac',
'id'=>'id',
'source'=>$this->createUrl('request/suggestAccount'),
'options'=>array(
'delay'=>300,
'minLength'=>1,
'showAnim'=>'fold',
),
'htmlOptions'=>array(
'size'=>'20'
),
));
?>
</td>
</tr>