PDA

View Full Version : [FIXED] SelectField setRecord bug



Di Peng
10 Nov 2011, 8:32 AM
Bug Tested on:
Latest Chrome, Ipad browser
Bug Description:

I have the following code snippet to illustrate the problem:


window.form = Ext.create('Ext.form.Panel', {
items: [
{xtype: 'selectfield', name: 'type',
options: [
{text: 'Home', value: 'Home'},
{text: 'Vacation', value: 'Vacation'}
]
}
]
});
Ext.define('Type', {
extend: 'Ext.data.Model',
fields: [{name: 'type', type: 'string'}]
});
var rec = Ext.create('Type', {type: 'Vacation'})
form.setRecord(rec);
Ext.Viewport.add(form);

The code can be run directly if you paste them in the launch function of Sencha application.

The problem is:
After the form is created. It shows 'Vacation' in the selectfield as expected. But once we execute this code


window.form.getValues();

we get {type: 'Home'} which is the first option in selectfield.

Thanks

AndreaCammarata
11 Nov 2011, 4:16 AM
Hi Di Peng.
Thanks for reporting this.
This issue has been fixed in PR2.

Hope this helps.