-
29 Jul 2008 1:43 AM #1
Write text in another tab by clicking on combobox
Write text in another tab by clicking on combobox
Hi all,
I need some help.
I have a modal window, separate in two parts.
Left : my store in combobox.
Center : three tabs.
When i choose one thing in my combobox i want to write a text in my first tab.
You know what i mean?
How can i do that?Code:var store = new Ext.data.SimpleStore({ fields: [ 'state'], data : exampleData }); var combo = new Ext.form.ComboBox({ store: store, displayField:'state', typeAhead: true, mode: 'local', emptyText:'Selection...', selectOnFocus:true ,listeners:{select:{fn:function(combo, value) { alert( combo.getValue()); genre.body.update('some text');//genre -> first tab's id }} } });
IF you have idea... Thanks
SandrineLast edited by evant; 29 Jul 2008 at 1:47 AM. Reason: Code goes in [code][/code] tags, see: http://extjs.com/forum/misc.php?do=bbcode
-
29 Jul 2008 1:47 AM #2
That looks like the right way to go about it, what's the problem?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Jul 2008 1:53 AM #3
snif
snif
It's written :
genre.body is undefined .
Sniff
-
29 Jul 2008 1:58 AM #4
Ok, well you can't just treat a string as though it's a variable.
You need to either
a) Keep a reference to the tab when you create it
b) Use Ext.getCmp() to retrieve the component instanceEvan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Jul 2008 4:21 AM #5
alert( combo.getValue()); => it works
alert( Ext.getCmp('combo').getValue()); =>it doesnt work
Ext.getCmp("combo") is undefined
Did i forget something?
-
29 Jul 2008 4:23 AM #6
Wrong thing.
combo is a valid variable. genre is not, that's where you need getCmp. I'd suggest you read the documentation to understand why you need to do that.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Jul 2008 4:26 AM #7


Reply With Quote