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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:00:35+00:00 2026-05-11T05:00:35+00:00

I have written some code that works pretty well, but I have a strange

  • 0

I have written some code that works pretty well, but I have a strange bug Here is an example…


PLEASE WATCH MY COMBOBOX BUG VIDEO


Like I said, this works well every time datachanged fires – the right index is selected and the displayField is displayed but, everytime after I type some text in the combobox, later, when the ‘datachanged’ fires, it wont display the displayField. Instead, it displays the value from the setValue method I launch.

The strange thing is that if I don’t ever type text and change the selection with the mouse there is no bug. Finally, this appears only when I type text in the combobox.

Has anyone heard of this bug, have a solution, or some wise advice?

The Code !

Two data stores :

ficheDataStore = new Ext.data.Store({     id: 'ficheDataStore',     autoLoad: true,     proxy: new Ext.data.HttpProxy({         url: 'ficheDetail.aspx',      // File to connect to         method: 'GET'     }),     baseParams: { clientId: clientId, Type: 'Fiche' }, // this parameter asks for listing     reader: new Ext.data.JsonReader({   // we tell the datastore where to get his data from         root: 'results'     }, [         { name: 'GUID', type: 'string', mapping: 'GUID' },         { name: 'TagClient', type: 'string', mapping: 'TagClient' },         { name: 'Nom', type: 'string', mapping: 'Nom' },         { name: 'Compteur', type: 'string', mapping: 'CompteurCommunes' },         { name: 'CompteurCommunesFacturation', type: 'string', mapping: 'CompteurCommunesFacturation' },         { name: 'AdresseFacturation', type: 'string', mapping: 'AdresseFacturation' },         { name: 'Codes', type: 'string', mapping: 'Codes' },         { name: 'Observations', type: 'string', mapping: 'Observations' },         { name: 'Adresse', type: 'string', mapping: 'Adresse' }        ]) });   communesDataStore = new Ext.data.Store({     autoLoad: true,     proxy: new Ext.data.HttpProxy({ url: 'ficheDetail.aspx?Type=Communes' }),     reader: new Ext.data.JsonReader({ root: 'results' }, [{ name: 'Compteur' }, { name: 'Localisation'}]) }); 

Who return something like this for the first:

  {results:[{'Nom':'cercle interieur'},{'Observations':''},{'Codes':' '},{'Adresse':'dd'},{'CompteurCommunes'     :'1'},{'TagClient':'3-56'},{'GUID':'443609c6-d064-4676-a492-7baa7b4288d1'},{'AdresseFacturation':''}     ,{'CompteurCommunesFacturation':'1'}]} 

For the latter :

{'results':[{ 'Compteur' : '1','Localisation' : '6200  ST ISIDORE'},{ 'Compteur' : '2','Localisation'  : '21340 CHANGE'},{ 'Compteur' : '3','Localisation' : '1200  ELOISE'},{ 'Compteur' : '4','Localisation'  : '1200  ST GERMAIN SUR RHONE'},{ 'Compteur' : '5','Localisation' : '75000 PARIS'},{ 'Compteur' : '6' ,'Localisation' : '75001 PARIS 1ER ARRONDISSEMENT'}]} 

a Combobox :

 var comb = new Ext.form.ComboBox(              {                store: communesDataStore,                fieldLabel: 'Code postal',                // hiddenName: 'Compteur',                name: 'CompteurCommune',                id: 'CompteurCommunes',                width: 300,                typeAhead: true,                mode: 'local',                minChars: 0,                selecOnFocus: true,                forceSelection: true,                valueField: 'Compteur',                displayField: 'Localisation',                autocomplete: true,                emptyText: 'Selectionnez un code postal',                triggerAction: 'all',                value: ''               }); 

in a datachanged event i set the new value of the Combobox ‘CompteurCommunes’ :

   ficheDataStore.addListener('datachanged', handleDatachangedEvent);       function handleDatachangedEvent()         {         try {               comb.setValue(ficheDataStore.getAt(4).data.Compteur);                                                                                              }         catch (err) { }         } 
  • 1 1 Answer
  • 2 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. 2026-05-11T05:00:35+00:00Added an answer on May 11, 2026 at 5:00 am

    It’s probably because when you type random data into combo, it may not locate correct fieldValue every time. Then it stucks at the last non-existing value.

    Try to set ComboBox to any existing value (in combo’s datastore) before doing new setValue() in your datachanged event handler. Or you can try to use clearValue() method to reset the previous (undefined) valueField.

    There also initList() method existing to reset combo to initial state.

    EDIT: After some testing, I found that: combo.store.clearFilter(); must be used before setValue in the external event handler.

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

Sidebar

Related Questions

I have an application written in C# that invokes some C code as well.
I have written some code to ensure that items on an order are all
I have written some WebGL code, actually I am playing with the examples that
I have a c++ source code that was written in linux/unix environment by some
I'have written a simple code, that gets accelerometer&orientation meter and display some graphics based
I have written some code to display a YouTube video on my page but
I have written some C++ code that generates a std::vector. I also have a
I have written some code which works without errors. The code uses MySQLdb for
I've written some code that uses stringWithContentsOfURL , but it turns out that it
I have written some code for playing a .wav through my application. Now I

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.