Dialog with ajax loading AutoComplete


I have problem with Dialog from jQuery UI and AutoComplete.

On my page I use Dialog from ZII extension:


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










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

success: function(html){




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…


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

function selectProduct() {





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




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

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








         'type' =&gt; 'raw',

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



)); ?>