创建Store
Ext.define('common.EnterpriseLevel', {
extend: 'Ext.data.Store',
alias: 'widget.EnterpriseLevel',
autoLoad: true,
autoSync: false,
model: 'model.CustomerModel',
proxy: {
type: 'ajax',
api: {
read: '/Customer/GetCustName'
},
reader: {
type: 'json',
successProperty: 'success',
rootProperty: 'data',
messageProperty: 'message'
},
//extraParams: { },
listeners: {
exception: function (proxy, response, operation) {
Ext.MessageBox.show({
title: 'REMOTE EXCEPTION',
msg: operation.getError(),
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
}
});
创建Model
<pre name="code" class="javascript">Ext.define('model.CustomerModel', {
extend: 'Ext.data.Model',
alias: 'widget.CustomerModel',
fields: [
{ name: 'CustID', type: 'string' },
{ name: 'CustomerName', type: 'string' }
]
});
ExtJs教程----创建Store
最新推荐文章于 2018-09-27 23:11:46 发布