Dialog with ajax loading AutoComplete

Hi,

I have problem with Dialog from jQuery UI and AutoComplete.

On my page I use Dialog from ZII extension:




<?php

$this->beginWidget('zii.widgets.jui.CJuiDialog', array(

    'id'=>'click',

    'options'=>array(

        'title'=>'Title',

        'autoOpen'=>false,

        'width'=>700,

    ),

));


$this->endWidget('zii.widgets.jui.CJuiDialog');


?>



now, when I click on selected link, #click content is replaced by ajax request. Ajax content contains form with autocomplete field.




success: function(html){

   jQuery('#click').html(html);

   jQuery('#click').dialog('open');

},



When ajax loading is success I try open dialog but this ends with error:

Has anyone met with a similar problem?

Thanks for help.

Yes I got the same problem after showing a CJuiDialog which contains a search form. Th search form’s results are displayed on the same dialog via ajax using a zii CGrid. Then all of my links to CJuiDialog forms stop working. The CJuiDialog “Close” button also won’t work

I suspect that there may be a problem with two instances of jQuery:

one from ZII and other from AutoComplete.

But how to fix it?

I encountered same problem…

A CGridView placed inside the CJuiDialog.

Clicking the Select button will close the CJuiDialog but unfortunately the error occured "$(this).dialog is not a function"

My Code…

<?php

Yii::app()->clientScript->registerScript(‘selectProduct’, "

function selectProduct() {


    &#036;('#dlgFindProducts').dialog('close');


}


&quot;);

?>

<?php $this->widget(‘zii.widgets.grid.CGridView’, array(

'id'=&gt;'products-grid',


'dataProvider'=&gt;&#036;model-&gt;search(),


'filter'=&gt;&#036;model,


'ajaxUpdate' =&gt; '.products-container',


'pager'=&gt; array('class'=&gt;'AjaxLinkPager'),


'columns'=&gt;array(


	'id',


	'prod_num',


	'prod_name',


    'selling_price',


    


    array(


         'type' =&gt; 'raw',


         'value' =&gt;  &quot;CHtml::button('Select',array('onclick'=&gt;'selectProduct();'))&quot;,


        ),





),

)); ?>