PDA

View Full Version : Setting default value to the combo



venu
10 Aug 2009, 2:43 AM
Hi,

I want to set default value for a combo, i seen some of the posts but the code is not working.The combo is in the toolbar as an item.

Here is my code


this.tbar1 = new Ext.Toolbar({
height: 25,
items: [
{
xtype: 'combo',
width: 100,
name: 'filterBy',
store: new Ext.data.SimpleStore({
fields: ['id', 'name'],
data : [
['All', 'All'],
['Item', 'Items'],
['Tuple', 'Tuples'],
['ComplexItem', 'Complex Types']
]
}),
displayField:'name',
typeAhead : false,
editable : false,
selectOnFocus:true,
mode: 'local',
triggerAction: 'all',
emptyText: 'Show only..',
}
}
]
});

This toolbar is the part of treepanel.


Let me know how to solve this problem.

Thanks,
Venu

Lloyd K
10 Aug 2009, 2:56 AM
Surely just add:



valueField: "id",
value: 'All',


To the config?