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

  • SEARCH
  • Home
  • 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 6652775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:10:59+00:00 2026-05-26T01:10:59+00:00

In my JQgrid i have a ui atocomplete column which are Case sensitive. For

  • 0

In my JQgrid i have a ui atocomplete column which are Case sensitive.

For example i have 2 Items in my grid: Ivan and ivan, if i type “i” autocomplete will return only ivan.
I have tryed to make a function inside of source: but i failed since my ajax call always return object Object instead of an item. Any ideas?

Code for autocomplete:

$(elem).autocomplete({
                      delay: 0,
                      minLength: 0,

                      source: function (req, response) {
                          alert(req);
                          $.ajax({
                              mtype: "post",
                              url: '@Url.Action("GetBrands")',
                               dataType: "json",
                              async: false,
                              cache: false,
                              data: { term: req },
                              success: function (data) {
                                  alert(data);

                                  var re = $.ui.autocomplete.escapeRegex(req.term);

                                  var matcher = new RegExp("^" + re, "i");

                                  response($.grep(data, function (item) { return matcher.test(item.value); }));

                              }

                          });

                      },

Controller side code:

 public virtual JsonResult GetBrands(string term)
    {
        if (term == null) term = string.Empty;

        var vendorId = _service.GetVendorIdByUsername(GetUserName());

        var brands = _service.GetBrandsByVendor(vendorId);
        var brand = new BrandsViewModel();
        brand.BrandName = "Opret ny Brand...";
        brands.Add(brand);

        foreach (var brandsViewModel in brands)
        {

            if (brandsViewModel.BrandName == "Intet")
            {
                brandsViewModel.BrandName = "";
            }
        }

        return Json((from item in brands
                     where item.BrandName.Contains(term)
                     select new
                                {
                                    value = item.BrandName
                                    //votes = item.Votes,
                                }).ToArray(),
                    JsonRequestBehavior.AllowGet);
    }
  • 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-26T01:10:59+00:00Added an answer on May 26, 2026 at 1:10 am

    convert it all to one case when compering:

    public virtual JsonResult GetBrands(string term)
        {
            if (term == null) term = string.Empty;
            term = term.ToLower();
            var vendorId = _service.GetVendorIdByUsername(GetUserName());
    
            var brands = _service.GetBrandsByVendor(vendorId);
            var brand = new BrandsViewModel();
            brand.BrandName = "Opret ny Brand...";
            brands.Add(brand);
    
            foreach (var brandsViewModel in brands)
            {
    
                if (brandsViewModel.BrandName == "Intet")
                {
                    brandsViewModel.BrandName = "";
                }
            }
    
            return Json((from item in brands
                         where item.BrandName.ToLower().Contains(term)
                         select new
                                    {
                                        value = item.BrandName
                                        //votes = item.Votes,
                                    }).ToArray(),
                        JsonRequestBehavior.AllowGet);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQgrid column which would show data as in the below example.
I have a jqGrid with which users will select records. A large number of
in my jqgrid i have field in a table which represents the id and
I seem to have an issue where with jQuery Grid (jqGrid) if I have
Is there a way in jqgrid to have an editable column that uses a
Is it possible to make it so that a jqGrid will have a width
I have a jqGrid on which clicking of a row should render a partial
I have a jqGrid (pared-down example below) where I need rather complicated validation to
I have a jqGrid which when a row is selected, a jQuery UI modal
I have a Jqgrid which has datatype as local. I am loading data at

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.