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 6838667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:37:28+00:00 2026-05-26T23:37:28+00:00

I have JSON data returned in my action controller: $results = $repo->getMatchingCityName($searchTerm); Response that

  • 0

I have JSON data returned in my action controller:

$results = $repo->getMatchingCityName($searchTerm);

Response that i’m getting:

[{"CityName":"Montreal"},{"CityName":"New york"}]........

But jquery ui autocomplete doesn’t show anything

tried

$this->_helper->json(array_values($results));

and

Zend_Json::encode($results);

But no use. How do I convert into

[{"value":"Montreal","label":"Montreal"},{"value":"New york","label":"New york"}]
  • 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-26T23:37:28+00:00Added an answer on May 26, 2026 at 11:37 pm

    I got it working like this

    $temp = array();
    foreach($results as $row)
    {
        $value = $row["CityName"];
        array_push($temp, array(
            "label" => $value,
            "value" => $value
        ));
    }
    
    $data = $this->_helper->json($temp);
    $this->_helper->autoComplete($data);
    

    Added the view helper in bootstrap

    Zend_Controller_Action_HelperBroker::addHelper(
        new ZendX_JQuery_Controller_Action_Helper_AutoComplete()
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm have trouble grabbing the response JSON data that's returned via AJAX call. Here
I have the follow data returned via JSON {rows:[{Date:07/10/2011,Value:1206,Action:Drink}, {Date:07/11/2011,Value:2288,Action:Pie}, {Date:07/12/2011,Value:1070,Action:Drink}, {Date:07/13/2011,Value:1535,Action:Beer}, {Date:07/14/2011,Value:1721,Action:Drink}], page:1,total:1,records:5}
I have the following JSON data being returned, but for some reason, Javascript or
I have an Action Method that returns a JSON-serialized object. The problem I'm having
I have the following JSON returned from an AJAX call: {rows:[{Date:07/10/2011,Value:1206,Action:Drink}, {Date:07/11/2011,Value:2288,Action:Pie}, {Date:07/12/2011,Value:1070,Action:Drink}, {Date:07/13/2011,Value:1535,Action:Beer},
A] Problem summary: I have JSON data being returned from python to javascript. I
I have JSON data (added a newline for readability) returned as [{pk: 7, model:
I have the following JSON data being returned by a webservice: {d:[ {RelationshipManager:{},AdvisoryId:13,ClientId:22,UserId:13,AdvisoryMessage:Welcome!,Seen:false,Issued:\/Date(1312123970110)\/,Delivered:null,Importance:3}, {RelationshipManager:{},AdvisoryId:14,ClientId:22,UserId:13,AdvisoryMessage:A
i have json data like this {GetStudentDetails: {TotalCount:5, RootResults:[ {city:West Chester,country:USA,state:PA ,student_id:100}, {city:Philly,country:USA,state:PA,student_id:101}, {city:Buffalo,country:USA,state:NY,student_id:102},
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:

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.