我知道这晚了一年,但迟到总比没有好,因为我发现它没有得到答复,试试这个:
首先创建您的商店:
var myComboStore = Ext.create('Ext.data.Store', {
storeId:'myComboStore',
fields: ['name', 'value'],
data: [
{'name':'shelf1', 'value':'shelf1 val'},
{'name':'shelf2', 'value':'shelf2 val'},
{'name':'shelf3', 'value':'shelf3 val'},
{'name':'shelf4', 'value':'shelf4 val'}
]
});
然后在您的组合配置中,分配商店。此面板 (fp) 是一个用于保存示例组合的简单表单。
var fp = {
xtype : 'form',
frame : true,
labelWidth : 110,
items:
{
xtype: 'combobox',
fieldLabel: 'My Combo',
displayField: 'name',
width: 320,
store: myComboStore, // ASSIGN STORE TO COMBO
queryMode: 'local',
typeAhead: true,
emptyText : '-none-',
listeners : {
//click events for item selection goes here
}
}
}
为面板创建一个窗口
new Ext.Window({
title : '',
layout : 'fit',
height : 180,
width : 320,
border : false,
items : fp
}).show();
工作小提琴:https://fiddle.sencha.com/#fiddle/1cta