ExtJs学习资料26-Ext.data.GroupingStore数据表格按组显示操作.doc

上传人:PIYPING 文档编号:10613390 上传时间:2021-05-26 格式:DOC 页数:2 大小:80KB
返回 下载 相关 举报
ExtJs学习资料26-Ext.data.GroupingStore数据表格按组显示操作.doc_第1页
第1页 / 共2页
ExtJs学习资料26-Ext.data.GroupingStore数据表格按组显示操作.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《ExtJs学习资料26-Ext.data.GroupingStore数据表格按组显示操作.doc》由会员分享,可在线阅读,更多相关《ExtJs学习资料26-Ext.data.GroupingStore数据表格按组显示操作.doc(2页珍藏版)》请在三一文库上搜索。

1、ExtJs学习资料Ext.data.GroupingStore数据表格按组显示操作2021年5月8日星期六1、引入ExtJs框架文件(存入Global.js文件中)document.write( );document.write();document.write();document.write();2、引入Global.js文件3、效果图=4、JS源代码Ext.onReady(function()/-开始-/=将数值转为货币形式=function float_money(cellValue) return (Ext.util.Format.usMoney(cellValue); /=/*js

2、onDataInfo.asp源文件:success:true,total:4,rows:id:1,title:OfficeSpace1,director:MikeJudge1,released:1999-02-19,genre:1,tagline:Work Sucks1,price:19.05,active:1,id:2,title:OfficeSpace2,director:MikeJudge2,released:1999-02-19,genre:1,tagline:Work Sucks2,price:29.05,active:1,id:3,title:OfficeSpace3,direct

3、or:MikeJudge3,released:1999-02-19,genre:2,tagline:Work Sucks3,price:39.05,active:1,id:4,title:Office Space4,director:Mike Judge4,released:1999-02-19,genre:2,tagline:Work Sucks4,price:49.05,active:1*/var _store=new Ext.data.GroupingStore(proxy:new Ext.data.HttpProxy( url:jsonDataInfo.asp, /请求数据的URL地址

4、method:POST /请求方式GET和POST),reader:new Ext.data.JsonReader( /解析数据格式id:id,/id:一个数据行对象的属性名,它包含数据行的id值/totalProperty:从其中可以获得数据集记录的总大小。 /当整个数据集不是一次性返回,而是在服务器端做好分页时,才需要此参数totalProperty:total,successProperty:success,/successProperty:从其中可以获得供表单使用的success参数root:rows/root:它包含数据行数组,Ext.data.Record.create(id,ti

5、tle,director,name:released,type:date,dateFormat:Y-m-d,genre,tagline,name:price,type:float,name:active,type:bool),sortInfo: field:director,direction:ASC , /排序方式设置groupField:director, /对store中数据进行分组所依据的字段名称(默认值为)autoLoad:true /如果传入此值,store将在被创建后使用autoLoad对象作为参数自动调用load方法);var _grid=new Ext.grid.GridPa

6、nel(title:实现读取服务器端JSON数据并分组显示, width:600, height:280, frame:true, renderTo:Ext.getBody(),/*viewConfig: forceFit:true, autoFill:true ,*/store:_store,columns:header:序号,dataIndex:id,width:80,sortable:true,header:标题,dataIndex:title,id:title,width:120,header:导演,dataIndex:director,align:center,header:放映日期

7、,dataIndex:released,renderer:Ext.util.Format.dateRenderer(Y-m-d),header:语种,dataIndex:tagline,header:票价,dataIndex:price,renderer:float_money,view:new Ext.grid.GroupingView(/grid中的Ext.grid.GridView 对象. 这个可以在调用render()之前设置forceFit:true,autoFill:true),autoExpandColumn:title /grid中列的id,改列将会扩展宽度以致填满剩余空间.这个列id不能为0.);/-结束-);第 2 页 / 共 2 页

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1