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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:09:17+00:00 2026-05-27T22:09:17+00:00

jQuery UI Autocomplete (code below) works just fine when the returned JSON is an

  • 0

jQuery UI Autocomplete (code below) works just fine when the returned JSON is an Array. But my returned JSON is an object that contains an array. So instead of being Rows[] it’s Object.Rows[]

I can’t seem to get the syntax right below. I would have thought item would have just switched to item.Rows, but that did not seem to work. Help

$('#reportingLocationLookup').autocomplete({
    minLength: 3,
    delay: 1000, //milliseconds,  
    source: function (request, response) {
        var dto = { 'term': request.term, 'take': 10 };
        //Ajax
        var urlMethod = window.siteRoot + "Invoices/ListPostalLocations";
        var jsonData = JSON.stringify(dto);
        window.SendAjax(urlMethod, jsonData, response);
    },
    focus: function () {
        return false;
    },
    select: function (event, ui) {
        return false;
    }
}).data("autocomplete")._renderItem = function (ul, item) {
    return $("<li></li>")
    .data("item.autocomplete", item)
    .append("<a>" + item.PostalCode + " - " + item.CityAlias + ", " + item.StateAbbreviation + "</a>").appendTo(ul);
};
  • 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-27T22:09:17+00:00Added an answer on May 27, 2026 at 10:09 pm

    The autocomplete widget expects an Array to be supplied to the response function. What this means is that you’re going to have to tweak the success argument of your SendAjax call:

    /* snip */
    source: function (request, response) {
        var dto = { 'term': request.term, 'take': 10 };
        //Ajax
        var urlMethod = window.siteRoot + "Invoices/ListPostalLocations";
        var jsonData = JSON.stringify(dto);
        window.SendAjax(urlMethod, jsonData, function(data) {
            response(data.Rows);
        });
    },
    /* snip */
    

    Basically, send response (autocomplete’s supplied callback function) the array in your response object.

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

Sidebar

Related Questions

I'm doing jQuery autocomplete. Works fine if I put hard codded JSON array. But
The following autocomplete code works with Jquery 1.4.4 but not with 1.5.1. I am
When i use the below code in webpage (.aspx file), it works fine; but
The below code is very simple. I have a jQuery autocomplete bound to an
I wrote code that fails to use the JQuery autocomplete to fire a result
I am using jQuery autocomplete which is working fine with existing element but not
Below is the JS (jQuery) code of autocomplete's result function. You can see there's
Below are my code for jQuery UI, the problem I am facing is that
I placed all code below. My page works like that Page's first scene When
How is ti possible that the code below show the array ONLY if the

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.