CJuiAutoComplete autocomplete

Questions and answers about change of functions, design, hosting etc.

Moderators: Koduc, Xpycm

Forum rules
Pay attention! Forum is not a means for guaranteed support of clients and users. An answer as well as a quick answer is not supposed on the forum. We post messages as soon as possible.

The message limit on the forum is 3 messages per day.
If you want to say "thank you" then use the function "Give good reputation point", which is a green icon "plus" under the nickname of the person, who answered the message.

CJuiAutoComplete autocomplete

Postby Ashwini » 28 Mar 2016, 16:26

how to include CJuiAutoComplete widget in home page..

I am writting the actionAutocompleteTest($term) function to C:\wamp\www\protected\modules\apartments\controllers\backend\MainController.php
public function actionAutocompleteTest($term)
{
$res =array();

$qtxt ="SELECT name_en FROM {{location_city}} WHERE name_en LIKE :username";
$command =Yii::app()->db->createCommand($qtxt);
$command->bindValue(":username", '%'.$term.'%', PDO::PARAM_STR);
$res =$command->queryColumn();


echo CJSON::encode($res);

Yii::app()->end();
}



and this is my second file where i call above function
C:\wamp\www\themes\atlas\views\site\_search_field_term.php
<?php
$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
'name'=>'apartment',
'value'=>'test21',
'source'=>$this->createUrl('/apartments/backend/main/autocompleteTest'),
'options'=>array(
'delay'=>300,
'minLength'=>1,
'showAnim'=>'fold',

'focus'=>'js:function(event, ui) {
$("#xx").val(ui.item.label);
return false;
}',

'select'=>"js:function(event, ui) {
$('#xx').val(ui.item.label);
return false;
}",
),
'htmlOptions'=>array(
'size'=>'40'
),
));
?>

But its not work properly..plz suggest me how to include CJuiAutoComplete widget
Ashwini
Passer
 
Posts: 44
Joined: 03 Aug 2015, 12:41
Reputation point: 0

Re: CJuiAutoComplete autocomplete

Postby fisher » 29 Mar 2016, 13:51

We should take a look at your site and see what changes were done.
Right now we can't give any instructions.
fisher
Citizen
Citizen
 
Posts: 63
Joined: 15 Apr 2013, 09:30
Reputation point: 1


Return to Questions and help for changes

Who is online

Users browsing this forum: No registered users and 36 guests

cron