Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:59:58+00:00 2026-05-23T11:59:58+00:00

I have an issue with the CJuiAutoComplete in Yii and using it with a

  • 0

I have an issue with the CJuiAutoComplete in Yii and using it with a model. I’ve been able to run a query within the function and pass that back, but not with using a model. It just returns no results. Can anyone see where the issue is?

This is the code in the controller:

public function actionAutocompleteTest() {
        $arr = array();
            foreach($models as $model) {
                $arr[] = array(
                'label'=>$model->pID,  // label for dropdown list          
                'value'=>$model->pID,  // value for input field          
                'id'=>$model->pName,            // return value from autocomplete
             );      
    }
        echo CJSON::encode($arr);

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

This is the code on the page:

<?php

    $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
        'model'=>'Players',
            'attribute'=>array('pID', 'pName'),
        'name'=>'test',
        'source'=>$this->createUrl('jui/autocompleteTest'),
        // additional javascript options for the autocomplete plugin
        'options'=>array(
                'showAnim'=>'fold',
                'select'=>'alert("hello"); return true;'
        ),
    ));

    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:59:59+00:00Added an answer on May 23, 2026 at 11:59 am

    actionAutocompleteTest will get the data sent by CJuiAtoComplete via post. So, you have to use the data to filter the results from the post, run the query and return the results.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have an issue updating magento product from frontend using a module that its function
i have done drag and drop using with jquery. here i have issue that
I have an issue that, while using sql server 2005 i have executed update
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue with jquery and history.back(): I got a link: <a href=#
I have issue wuth Firefox not displaying style text-decoration: line-through. I am using jqGrid
Im writing sql query and i have issue which i cannot fix. I'm trying
i have issue regarding Paging using filterexpression. here's the piece of code for filtering
I have issue to unbind one listeners that listen one of shared emitter: //
I have issue with sending AJAX body request using jQuery CORS with custom Content-type.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.