/** * Created by huangbaidong on 2016/9/18. * 产品组件通用Store, */ Ext.define(‘app.component.ebs.itemdata.ProductStore‘, { extend: ‘Ext.data.Store‘, autoLoad : true, constructor : function(config) { Ext.apply(config, { /*data:(function(){ var array = []; Ext.each(top.productStore.getData().items, function(item) { if(item.data.orgId == config.filterParams.orgId) { array.push(item); } }) return array; })()*/ proxy: { type: ‘ajax‘, url: ‘../EbsSystemItemData/queryAllProducts‘, reader: { type: ‘json‘, rootProperty: ‘datas‘, totalProperty: ‘total‘ }, extraParams: config.queryParams }, listeners:{ load : function( _this, records, successful, eOpts ) { //将store中model的id改为其他值。 Ext.each(records, function(record) { record.id = record.data.inventiryItemId; }); _this.setRecords(records); } } }); app.component.ebs.itemdata.ProductStore.superclass.constructor.call(this, config); } });
时间: 2024-10-27 08:00:16