qwerty
(qwerty)
December 15, 2009, 7:23am
1
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.
Spyros
(Spyros)
December 15, 2009, 7:50am
2
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
qwerty
(qwerty)
December 15, 2009, 8:00am
3
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?
linkinjaz
(Linkinjaz)
January 23, 2011, 4:50pm
4
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() {
$('#dlgFindProducts').dialog('close');
}
");
?>
<?php $this->widget(‘zii.widgets.grid.CGridView’, array(
'id'=>'products-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'ajaxUpdate' => '.products-container',
'pager'=> array('class'=>'AjaxLinkPager'),
'columns'=>array(
'id',
'prod_num',
'prod_name',
'selling_price',
array(
'type' => 'raw',
'value' => "CHtml::button('Select',array('onclick'=>'selectProduct();'))",
),
),
)); ?>