ext combo异步获取数据怎么配置store
1个回答
展开全部
给你个例子吧:
//Store的定义
var customerStore = new Ext.data.Store({
id: "ContractManagement.FromPanel.Customer.Store",
proxy: new Ext.data.HttpProxy({
url: 'Action/CustomerInfoAction.ashx?action=GetCustomers'
}),
reader: new Ext.data.JsonReader({}, ['ID', 'Name', 'Property', 'ProjectName', 'ProjectAddress', 'Contact', 'PhoneNumber'])
});
customerStore.load(); //数据的加载时机,根据自己的情况调整
//Form中的调用
xtype: "combo",
anchor: "95%",
id: "CustomerLabel",
name: "CustomerLabel",
fieldLabel: "项目名称",
hiddenName: 'CustomerID',
editable: false,
emptyText: '请选择项目...',
triggerAction: 'all',
valueField: 'ID',
displayField: 'ProjectName',
mode: 'local',
store: customerStore,
listeners: {...}
//Store的定义
var customerStore = new Ext.data.Store({
id: "ContractManagement.FromPanel.Customer.Store",
proxy: new Ext.data.HttpProxy({
url: 'Action/CustomerInfoAction.ashx?action=GetCustomers'
}),
reader: new Ext.data.JsonReader({}, ['ID', 'Name', 'Property', 'ProjectName', 'ProjectAddress', 'Contact', 'PhoneNumber'])
});
customerStore.load(); //数据的加载时机,根据自己的情况调整
//Form中的调用
xtype: "combo",
anchor: "95%",
id: "CustomerLabel",
name: "CustomerLabel",
fieldLabel: "项目名称",
hiddenName: 'CustomerID',
editable: false,
emptyText: '请选择项目...',
triggerAction: 'all',
valueField: 'ID',
displayField: 'ProjectName',
mode: 'local',
store: customerStore,
listeners: {...}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询