PDA

View Full Version : combobox dataview initialization



Nam
9 Oct 2009, 3:52 PM
Hey guys,

I have a combobox which loads in a form with a preset value from a store. The store has an additional value which I want to obtain, which is where I am having the problem. When the form loads, if I attempt run the following code, I get an error saying that the view property does not exist...


Ext.getCmp('ComboBoxID').view.getSelectedRecords()[0].data.otherProperty

But, if I expand the box, then run that code, everything works fine. It is only if I do not make a change to that field. I have looked for any option to initialize the view on render, but I have not been able to find anything yet. Does anyone have any ideas how I can get this to work properly?

Thanks,

Nam
9 Oct 2009, 4:00 PM
I came up with this, and it works fine. Thanks anyways guys.


Ext.getCmp('ComboBoxID').getStore().getAt(Ext.getCmp('ComboBoxID').getStore().find('value', EditTypeForm.getForm().findField('ComboBoxID').getValue())).data.otherProperty