View Full Version : How to set default value selected for Ext.form.Select

26 Aug 2011, 7:11 PM
I have a problem with Ext.form.Select

var storeComboStatus = new Ext.data.Store( {
fields: ['statusID', 'status'],
{statusID: 1,status: 'Deleted'},
{statusID: 2,status: 'Junked'},
{statusID: 3,status: 'Sold'},
{statusID: 4,status: 'Verify'},
{statusID: 5,status: 'Assigned'},
{statusID: 6,status: 'Available'}


var comboStatus = new Ext.form.Select(
id: 'comboxStatus',
label: 'Status',
store: storeComboStatus,
displayField: 'status',
valueField: 'statusID'

When page load i want select field display value selected is 'Verify'. But default value select is first value 'Deleted'.
I try search in Document API Sencha touch but don't see property or method can use
Help me!
Thank in advance

26 Aug 2011, 8:05 PM
you should be able to set the value property

var comboStatus = new Ext.form.Select( { id: 'comboxStatus', label: 'Status',value: 4, store: storeComboStatus, displayField: 'status', valueField: 'statusID' });

29 Aug 2011, 8:57 PM
Yeah! Thanks Nick :)