Answer the question
In order to leave comments, you need to log in
Why does the CJuiAutoComplete dropdown disappear when hovering the mouse in isAjaxRequest mode?
Good afternoon, there is such a problem,
There is a widget,
CJuiAutoComplete
$this->widget('zii.widgets.jui.CJuiAutoComplete',
[
'name'=>'place_id',
'value'=>'',
'source'=>Yii::app()->createUrl('places/autocomplete'),
'options'=>
[
'showAnim' => 'fold',
'minLength' => '3',
'select' => 'js:function( event, ui )
{
$("#placeSearch").val( ui.item.label );
$("#place_id").val( ui.item.id );
return false;
}',
],
'htmlOptions'=>
[
'onfocus' => 'js:
this.value = null; $("#place_id").val(null);
$("#selectedvalue").val(null);',
'class' => 'input-xxlarge search-query',
'name' => 'Hotels[place_id]',
'placeholder' => $model->place_id ? $model->place->name :
"Введите первые 3 и более буквы региона",
'id'=>'placeSearch'
],
]);
Yii::app()->clientScript->scriptMap =
[
'jquery.js' => false,
'jquery.ui.js' => false,
'jquery.yiiactiveform.js' => false,
];
$this->renderPartial('_formAjax',
[
'model' => $model,
'customers' => $customers,
'managers' => $managers,
'hotels' => $hotels,
], false, true);
Yii::app()->end();
'select' => 'js:function( event, ui )
{
$("#placeSearch").val( ui.item.label );
$("#place_id").val( ui.item.id );
return false;
}
display:block
<?php if(Yii::app()->request->isAjaxRequest): // && !isset($_GET['term']) ?>
<script type="text/javascript">
var elem = $('.ui-autocomplete.ui-menu.ui-widget.ui-widget-content.ui-corner-all');
elem.mouseenter(function()
{
console.log('Навели');
});
</script>
<?php endif;?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question