PDA

View Full Version : Select Fire Event not displaying the selected record



mayankagarwal1988
21 Nov 2014, 12:00 AM
Hi All,

I have a requirement of populating the selected record of one combobox to other combobox.
So I' am passing the value like this :-
var comboDown = Ext.ComponentQuery.query('combobox[itemId=filterColDataType]')[0];
comboDown.fireEvent('select',combobox);

I' am getting the 2 combobox's and then I' am firing the select event with the data of 1 combobox.
It is working but the problem is the value is not populating in the 2 combobox means 2 combobox is having the values but not displaying the selected index.

Thanks for the help in advance.

joel.watson
21 Nov 2014, 7:11 PM
Hi All,

I have a requirement of populating the selected record of one combobox to other combobox.
So I' am passing the value like this :-
var comboDown = Ext.ComponentQuery.query('combobox[itemId=filterColDataType]')[0];
comboDown.fireEvent('select',combobox);

I' am getting the 2 combobox's and then I' am firing the select event with the data of 1 combobox.
It is working but the problem is the value is not populating in the 2 combobox means 2 combobox is having the values but not displaying the selected index.

Thanks for the help in advance.

Hi mayankagarwal1988--

The select event of Ext.form.field.ComboBox (http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.form.field.ComboBox) doesn't select the record; rather, it's an event that is fired after a record is selected. In this way, it's not doing the selecting...it's a reaction to the selection.

For your needs, take a look at the select method (http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.form.field.ComboBox-method-select). Assuming that the comboboxes in question are using stores with the same model instances loaded, you should be able to pass the selected record from the first combobox select event to the second combobox's select method. I've included a simple example in a fiddle below.

Hope this helps!

dqs