oneofthelions
3 Feb 2011, 3:38 AM
I have local var (Array list) which has three key, value pairs.
I want the second value to be displayed in the combo box and its key as default.
Ext.onReady(function(){
var group = [['brand', 'Product'],['site', 'Location'],['environment', 'Environment']];
Ext.QuickTips.init();
var store = new Ext.data.ArrayStore({
fields: ['abbr', 'group'],
data : group
});
var combo = new Ext.form.ComboBox({
store: store,
displayField:'group',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Location', //So the 'Location' which is second value is to be displayed. And its key 'site'
selectOnFocus:true,
applyTo: 'local-states'
});
combo.selectByValue('site', true);
});
I want the second value to be displayed in the combo box and its key as default.
Ext.onReady(function(){
var group = [['brand', 'Product'],['site', 'Location'],['environment', 'Environment']];
Ext.QuickTips.init();
var store = new Ext.data.ArrayStore({
fields: ['abbr', 'group'],
data : group
});
var combo = new Ext.form.ComboBox({
store: store,
displayField:'group',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText:'Location', //So the 'Location' which is second value is to be displayed. And its key 'site'
selectOnFocus:true,
applyTo: 'local-states'
});
combo.selectByValue('site', true);
});