EXT3.3.0中的继承的问题,请教EXT达人
时间:2011-12-02
来源:互联网
为什么使用on异常
JScript code
JScript code
app.ux.AggregateStore=Ext.extend(Ext.data.GroupingStore,{ constructor:function(config){ Ext.apply(this,config); app.ux.AggregateStore.superclass.constructor.call(this); this.on('load',this.aggregate,this); }, aggregate:function(){//////实现数据的聚合用于统计图 var rec=null; this.each(function(record){ if(rec==null||rec.data[this.groupField]!=record.data[this.groupField]){ rec=new this.recordType(record.data,record.data[this.groupField]); return; } if(rec.data[this.groupField]==record.data[this.groupField]){ record.data[this.summaryField]+=rec.data[this.summaryField]; this.remove(rec); rec=record; } },this); // this.commitChanges(); } }) Ext.onReady(function(){ ////////////////////////// var board=new app.ux.PrintBoard(); board.initPrintBoard(); var localStore=new app.ux.AggregateStore({ url:'RecordLoader', root:'data', groupField:'brand', fields:['sequenceNumber', 'brand',{ name:'quantity', type:'int' },{ name:'total', type:'float' }], baseParams:{ start:0, limit:50, data:Ext.encode({ condition:'黄铜', fields:'fulltext', target:'detail', relative:'detail_fields' }) } }); localStore.on('load',function(){ ////FIREBUG调试,代码在此处无法执行为什么,该如何修改 ///////////////////////以下是画统计柱图的代码////////////////////////// var drawer=new app.ux.ChartDrawer({ fields:['brand','total','quantity'], // store:this.store, group:'brand', xField:'total', xField1:'quantity', yDisplayName:'数量', yDisplayName1:'总额', localStore:localStore }); board.draw(drawer,true); },this) localStore.load(); ///////////////////////////////////// })
作者: jinweifu 发布时间: 2011-12-02
改成这样试试 localStore.on('load',function(store,options){
作者: A_Q111 发布时间: 2011-12-03
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28