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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:24:30+00:00 2026-05-26T03:24:30+00:00

I have an extjs combobox used for auto-complete having following configuration: xtype:’combo’, displayField: ‘name’,

  • 0

I have an extjs combobox used for auto-complete having following configuration:

xtype:'combo',
displayField: 'name',
valueField:'id',
store: storeVar,
queryMode: 'remote',
minChars:2,
hideTrigger:true,
forceSelection:true,
typeAhead:true

There are two issues being faced by me:

a. If a user chooses a value from the list returned from server, but later wants to remove that value and keep combo-box empty, then also the old values re-appears on blur, not allowing combo-box to remain empty. How can I allow empty value in this combo-box in such a case? I understand it could be due to forceSelection:true, but then I need to keep it true as otherwise user can type any random value.

b. When the server returns an empty list, I want to display a message – No Values Found. I tried doing this, by putting this value in the displayField entity, i.e., {id:”, name:’No Value Found’}. But then in this case, the user is able to choose this value and send it to server which is not what is expected. Thus, how can I display the message for empty list?

Could someone please throw light on this?

  • 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-26T03:24:31+00:00Added an answer on May 26, 2026 at 3:24 am

    For the issue related to forceSelection in the question above, following is the hack created which can serve the expected purpose:

    Ext.override(Ext.form.field.ComboBox,{          
        assertValue: function() {
            var me = this,
                value = me.getRawValue(),
                rec;
            if (me.multiSelect) {
                // For multiselect, check that the current displayed value matches the current
                // selection, if it does not then revert to the most recent selection.
                if (value !== me.getDisplayValue()) {
                    me.setValue(me.lastSelection);
                }
            } else {
                // For single-select, match the displayed value to a record and select it,
                // if it does not match a record then revert to the most recent selection.
                rec = me.findRecordByDisplay(value);
                if (rec) {
                    me.select(rec);
                } else {
                    if(!value){
                        me.setValue('');
                    }else{
                        me.setValue(me.lastSelection);
                    }
                }
            }
            me.collapse();
        }
    });
    

    This needs to be included after library files of extjs have been included.

    For the other issue of message to be shown at No Values Found – emptyText – works fine as suggested by Varun.

    Hope this helps somone looking for something similar.

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

Sidebar

Related Questions

I have a combo-box with following configuration. { fieldLabel:'Service', xtype:'combo', displayField: 'srvcDesc', store: storeServiceCodeVar,
In extjs combobox, we have valueField, displayField . There is one getValue(). But there
I have the following extJs window which has two tabs in it. One of
For example if I have extjs ComboBox, and I have URL like http://localhost:8080?param=value1,value2,value3 How
I have an ExtJS combobox, which is a required field, but I don't want
I have ExtJS Grid. And I am using Roweditor plugin with combobox. When I
I want to implement the following combobox in ExtJS. The question is, how to
I am using ExtJS 3.4 . I have a structure with data for combobox
I am using extjs combobox for a sex field. It have two value M
I'm a newbie using Extjs 4.07. I have created a combobox (remote) queryMode. 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.