I’m trying to use multiple EJuiAutoCompleteFkField widgets in a single view (actually some ajax loaded divs within a view). Anyone know of a way to give the juiautocomplete widgets a uinque DOM ID so they can all function separately?
Currently only the first one works cause it’s not unique.
I was hoping for something like ‘htmloptions’ below to set the id, like you find in other Yii widgets
<?php
$this->widget('EJuiAutoCompleteFkField', array(
'model'=>$smpNull,
'attribute'=>'cancer_id', //the FK field (from CJuiInputWidget)
'sourceUrl'=>Yii::app()->createUrl('/samples/cancerAutoComplete'),
'showFKField'=>false,
'FKFieldSize'=>10,
'relName'=>'cancer', // the relation name defined above
'displayAttr'=>'CancerName', // attribute or pseudo-attribute to display
'autoCompleteLength'=>50,
'options'=>array(
'minLength'=>3,
),
'htmlOptions'=>array(
'id'=>'Events_cancer_id',
),
));
?>
Thanks !
Here’s how I modified the extension to enable multiple fields per page:
The new EJuiAutoCompleteFkField.php
and the usage in the view: