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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:44:04+00:00 2026-05-19T12:44:04+00:00

I just start with Dojo and my problem is the follow: I have a

  • 0

I just start with Dojo and my problem is the follow:
I have a FilteringSelect, where my search uses the idea of a like %john%.

So my filter will select and value with “john” in the list, so after write john I can have a list as:

Andrew John
John
John Alen
Simon John

So the “like” idea works fine.
The problem is: when I write “john” and press enter. The selected name is always the first in the list for instance “Andrew John” and not the second that is an exact match. Any one has an ideia how to solve this problem?

Thank you

  • 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-19T12:44:05+00:00Added an answer on May 19, 2026 at 12:44 pm

    The normal behaivour of the FilteringSelect is always get the first element of the combobox. Because usually this is the exact match. Due the fact that my serach was “like” in the text the first element is not always the exact macth.

    So, to solve my problem I changend the FilteringSelect.js, so I do a check to see if in the combobox option there is an exact match and return this element. The my case the exact match can be the second, third… in the combobox list. if there isn’t I return the first one (as was before).

    Here the code:

    > _callbackSetLabel: function(  /*Array*/ result,
                            /*Object*/ dataObject,
                            /*Boolean?*/ priorityChange){
        // summary:
        //      Callback function that dynamically sets the label of the
        //      ComboBox
        // setValue does a synchronous lookup,
        // so it calls _callbackSetLabel directly,
        // and so does not pass dataObject
        // still need to test against _lastQuery in case it came too late
    
    if((dataObject && dataObject.query[this.searchAttr] != this._lastQuery) || (!dataObject && result.length && this.store.getIdentity(result[0]) != this._lastQuery)){
                    return;
        }
                if(!result.length){
                    //#3268: do nothing on bad input
                    //#3285: change CSS to indicate error
                    this.valueNode.value = "";
                    dijit.form.TextBox.superclass._setValueAttr.call(this, "", priorityChange || (priorityChange === undefined && !this._focused));
                    this._isvalid = false;
                    this.validate(this._focused);
                    this.item = null;
                }else{          
                    //because the combobox have a like of the word the first element may no be the exact match
                     for(var j = 0; j < result.length; j++) {                   
                        //check if in the result there is the text that the user typed
                        if(dataObject && result[j].i["id"].toLowerCase() === dataObject.query[this.searchAttr].toLowerCase())
                        {
                            //return the exact match
                            this.set('item', result[j], priorityChange);
                            return;
                        }                   
                    }
                    // if there isn't a exact match return the first of the list
                    this.set('item', result[0], priorityChange);                
                }
            },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just start to learning Cocos2d and getting errors in Xcode 4.3.3 (4E3002). Problem in
hello i have just start using Raphael but i'm very confused in the following
I'd like to hava a Dojo dojox.grid.DataGrid with its data from a servlet. Problem:
I have just start to learn wpf. Can anybody clear me the following to
I have just start reading Let over lambda and I thought I would try
I am new and I just start my journey with libgdx. I would like
I just start a project where I need to have a WCF services that
I just start working on a project which I have to upgrade and upload
Just start to using Xcode. I made an IBOutlet from UIButton to have a
i just start to dive in ExtJS Grid, I would like create some toolbar

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.