-
27 Mar 2008 2:05 AM #1
ComboBox, onSelect and superclass
ComboBox, onSelect and superclass
Hi

I'm french and I'm new with extjs.
I'm trying to use the comboBox component, and i've got some problems.
I need to extend the select event of the combobox. I've read that when i use the onSelect i override the superclass event. I want to call this event but I don't know how to do.
I've saw how to call a method but i suppose events aren't methods...
If somebody can help me (just explain, I want to learn !!!).
I show you my code :
When I delete the onSelect code, combobox functions (offcourse ^^) but, as you can see, i want to update other fields (when i select an item).Code:var store_Fournisseur = new Ext.data.JsonStore({ // The url to send the request to url: '../ajax/index.php?a=libelleFournisseur', // What fields would you like mapped from the returned JSON fields: ['libelleFournisseur', 'id_fournisseur', 'referenceFournisseurAstel', 'addresseFournisseur', 'cleRIB'], root: 'fournisseurs', // The object in your JSON that holds your records totalProperty: 'record_count', // The object in JSON that holds the total count autoLoad: true // Load the data automatically upon JSON store creation }) var comboFournisseur = new Ext.form.ComboBox({ store: store_Fournisseur, displayField:'libelleFournisseur', typeAhead: true, mode: 'local', //necessaire pour afficher le chargement triggerAction: 'all', emptyText:'Choisir un fournisseur...', hideTrigger: false, selectOnFocus:true, applyTo: 'libelleFournisseur', onSelect: function(store_Fournisseur){ if(this.isExpanded()){ this.collapse(); } var referenceFournisseurAstel = document.getElementById('referenceFournisseurAstel'); referenceFournisseurAstel.value = store_Fournisseur.data.referenceFournisseurAstel; var addresseFournisseur = document.getElementById('addresseFournisseur'); addresseFournisseur.value = store_Fournisseur.data.addresseFournisseur; var cleRIB = document.getElementById('cleRIB'); cleRIB.value = store_Fournisseur.data.cleRIB; } });
Thank you for your help and sorry about my poor english :/
-
27 Mar 2008 4:32 AM #2
I see that i've made a mistake... I use the 2.x extjs not the 1.x. If somebody could move my thread... ?!!
thx =)
-
31 Mar 2008 5:41 AM #3
Please, some help will be really appreciated. I didn't find some codes or examples which explain on how to do. I read again and again API but there's nothing.... :/
I'm just looking for how to call the default listener onSelect of the comboBox, in order to extends his functionality.
Great thanks
-
7 Apr 2008 3:47 AM #4
I don't find the answer, and i need your help.
The problem is that the combobox doesn't select the item i want. It selects the first proposition in the list. That's why i need to call the default action of the combobox.
Thanks.
-
7 Apr 2008 6:47 AM #5
You might have a start by checking the tutorial on extending a class. There is also a stickied thread in the 2.0 forum that's a little more descriptive.
The extension is coincidentally about comboBox.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
8 Apr 2008 3:07 AM #6
Thank you,
I have already read the tutorial, and tried to extend "MyComboBox", without results, I will read your link in details. Thanks again =)
-
9 Apr 2008 1:10 AM #7
It's ok, i did it. Your link is really helpfully !
Thank you mjlecomte
-
9 Apr 2008 4:38 AM #8
Alright, good job.

It will help other users if you post your final solution, and especially if you include a few comments either in your code or outside of it, that describe what you needed to do to solve your problem.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote