由buffered:true引致Grid统计出错
来源:互联网 发布:linux ping不通外网ip 编辑:程序博客网 时间:2024/05/29 16:55
上星期五,在写一个Grid,里面有一个金额的字段需要进行统计,代码如下:
Ext.define('book',{extend:'Ext.data.Model',fields: [ {name: 'bookname'}, {name: 'bookprice'}, {name: 'author'} ]}); var bookstore = Ext.create('Ext.data.Store',{model: 'book',autoLoad:true,buffered: true,proxy:{type:'ajax',url:'books.json',reader:{type:'json',root:'bookList'}}});
................................. { xtype:'grid', store:bookstore, title: 'books',columnLines: true, frame:false, padding: '5 5 5 5', enableColumnHide :false,selType:'rowmodel', height: 500, width: '100%', plugins:'bufferedrenderer', features: [ {ftype: 'summary'} ],//dockedItems:[pageInfo],viewConfig:{forceFit:true,stripeRows:true,scrollDelta:160}, columns: [ Ext.create('Ext.grid.RowNumberer',{text: 'No', width: 52}), { text: '书名', dataIndex: 'bookname',width: 400, sortable: false }, { text: '金额', dataIndex: 'bookprice',align: 'right', xtype: 'numbercolumn', format: '0,000.00', width: 130, sortable: false, summaryType: 'sum', summaryRenderer: function(value){ Ext.util.Format.thousandSeparator= ','; Ext.util.Format.decimalSeparator='.'; return '合计:'+Ext.util.Format.number(value, '0,000.00') } }, { text: '作者', dataIndex: 'author',width: 130, sortable: false }, ..........................................
books.json内容如下:
bookList:[ {bookname: 'java从入门到精通', bookprice: 56.40}, {bookname: 'java Web编程', bookprice: 72.30}, {bookname: 'Python Web编程', bookprice: 32.30}, {bookname: 'Javascript高级程序设计', bookprice: 93.20}]}
以上代码,运行时却显示不出结果,出错信息如下图:
后来将store的buffered:true,改成false,或删除,则运行正常。
如何使用buffered, 请参看 http://blog.csdn.net/wilsonyun/article/details/46513881
0 0
- 由buffered:true引致Grid统计出错
- Magento后台Grid表使用了Group By导致统计出错的解决办法
- 由@DynamicInsert(true) @DynamicUpdate(true)引发的“血案”
- Grid使用模板(template)出错 (备忘)
- Java -- Buffered
- java---Buffered
- Fully buffered & Line buffered & Unbuffered
- STING:统计信息网格(STatistical INformation Grid)
- Extjs4--grid表格的分组和统计
- 由一对多引谈Hibernate的inverse="true"属性
- EXT 上传文件时加上fileUpload: true出错的问题。
- 由实例出发看看Ext——《Property Grid》
- TRUE
- 用php做统计出错心得
- Help my grid’s remote sorting (remoteSort:true) is not working after moving to Extjs 4
- Dime Buffered Upload
- buffered printf issue
- perl: non-buffered write
- 第七章:管理维护Replica Sets(读写分离&故障转移&增删节点)
- 如何查看和分析IIS日志
- Ubuntu 12.04 安装 skype
- 【分布式版本控制Git】(三)Git的使用
- 第八章:sharding 分片
- 由buffered:true引致Grid统计出错
- 禁止输入各种表情符号
- 供应商寄售项目仓库报废流程操作
- js 中的 prototype
- 集群添加节点失败
- RTP错误----ERROR: Couldn't create the RTP or RTCP socket
- 进阶排序算法
- [POI 2011]Lightning Conductor(DP优化)
- 第二章 递归与分治策略