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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:27:35+00:00 2026-06-13T04:27:35+00:00

I’m using ExtJS 4 and looking for a way I can hide currently selected

  • 0

I’m using ExtJS 4 and looking for a way I can hide currently selected value from combo’s dropdown list?

So instead of this (“Alaska” currently selected in combobox):

default combobox behaviour

I want the list of values look like this:

enter image description here

In my case the combobox is not editable (i.e. you can’t input an arbitrary value), I don’t think it makes much sense to display the selected value two times: once in the input field and once in the dropdown list. I already see what is selected, I want the dropdown list to only show me other options I can select.

So far I don’t see an easy way to do it. Probably the best place to start at is filtering combobox store but combobox uses its own filters for live search functionality.

Anybody considered this problem? Am I trying to do something weird?
I’m surprised that I haven’t been able to find any related topics.

  • 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-06-13T04:27:36+00:00Added an answer on June 13, 2026 at 4:27 am

    I ended up using a modified version of @sra’s solution:

    Ext.define('My.ComboBox',  {
        extend: 'Ext.form.field.ComboBox',
    
        /**
         * @cfg {Boolean} hideActive=true
         * When true, hides the currently selected value from the dropdown list
         */
        hideActive: true,
    
        /**
        * @private {Ext.data.Model[]} selectedRecords
        * A Array of selected records, used when hideActive is true
        */
    
        initComponent: function() {
            this.selectedRecords = [];
    
            this.callParent();
        },
    
    
        setValue: function(value, doSelect) {
            var store = this.store;
    
            if(this.hideActive) {
                store.suspendEvents(false);
                // write the current selected back to the store (you need to suspend autoSync if active)
                // do this BEFORE callParent so the currently selected record would be found in the store
                store.add(this.selectedRecords);
            }
    
            this.callParent(arguments);
    
            if(this.hideActive) {
                // set the selected as new recordlist
                this.selectedRecords = this.valueModels;
                // remove the selected from the store
                store.remove(this.valueModels);
                store.resumeEvents();
                store.fireEvent('refresh', store);
            }
    
            return this;
        }
    
    });
    

    The ‘hiding’ logic is the same, only I perform it in the setValue method to make sure that it also works when programmatically setting combo’s value, including the case where the combobox is initialized with a value.

    UPD Also, looks like store.add(this.selectedRecords); has to be called before this.callParent(arguments);, otherwise combobox will act weird if we attempt to set the same value twice (it simply wouldn’t find the active record in the store cause we removed it, so it’ll reset to blank).
    I suspend store’s events to prevent some quirks caused by combobox trying to synchronize with its dropdown list in the middle of my manipulations with selected record(s) and manually trigger store’s 'refresh' event when I’m done so the list gets eventually updated. This may have performance impact but so far I don’t know a better solution.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Does anyone know how can I replace this 2 symbol below from the string
I am currently running into a problem where an element is coming back from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I want use html5's new tag to play a wav file (currently only supported

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.