-
13 Jun 2012 11:03 PM #1
Submit Combo Box Value Into Text Area
Submit Combo Box Value Into Text Area
I have one combobox (Ext.form.ComboBox) and one textarea (xtype:'textarea',) inside a form window.
Whenever the value inside combobox is selected, the value should submitted and filling the text area.
I realize there is "select" method on combobox. But how to realize that functionality to transfer the selected value into text area.
How to do that?
Thanks in advance.
-
14 Jun 2012 12:19 AM #2
Hi,
Try below code:
Code:xtype: 'form' , items: [ { xtype: 'combo' , fieldLabel: 'Combo' , name: 'combo' , typeAhead: true , triggerAction: 'all' , lazyRender: true , mode: 'local' , store: { xtype: 'arraystore' , data: [ ['Value01', 'v01'], ['Value02', 'v02'], ['Value03', 'v03'], ] , fields: ['display', 'value'] } , valueField: 'value' , displayField: 'display' , listeners: { select: function () { this.nextSibling().setValue(this.getRawValue()); } } }, { xtype: 'textarea' , fieldLabel: 'Text Area' , name: 'textArea' } ]sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
14 Jun 2012 12:58 AM #3
It's work!
It's work!
Thanks a lot, sword-it. It's just work. Many many thanks.
But, how to extend the functionality, so the textarea can filled by multiple value from selected combobox? Because for now, the text area only receipt only one selected value.
Thanks in advance.
-
14 Jun 2012 2:19 AM #4
Hi!
Try This:-
Code:listeners: { select: function () { var textArea=this.nextSibling() ,textAreaValue=textArea.getValue() , comboValue=this.getValue() ,newValue=textAreaValue.concat(comboValue); textArea.setValue(newValue); } }sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.


Reply With Quote