- 浏览: 2105972 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
sunzeshan:
找了很久,用了这个插件解决问题啦。谢谢
eclipse jetty debug source not found -
xiaosong0112:
您好,请问为什么要这样设置呢,原理是什么?在网上很多转帖都没有 ...
maven的jetty插件提示No Transaction manager found导致启动慢的解决方法 -
eimhee:
tjzx 写道畅搜谷歌:http://dian168.cc/打 ...
Google 镜像站搜集 -
tjzx:
畅搜谷歌:http://dian168.cc/打开的是“最火源 ...
Google 镜像站搜集 -
eimhee:
finallygo 写道你这属于"头痛医头脚痛医脚& ...
解决linux下too many file问题
How does one get a JSONDataModel for the grid? I see JsonReader, but how do I use that with the grid? Do I need to create a Ext.data.Store?
#2
02-19-2007, 12:57 PM
|
Take a look at the page grid example, it uses a JsonReader.
|
#3
02-19-2007, 01:00 PM
|
|
Quote:
|
#4
02-19-2007, 01:08 PM
|
If you are only doing "in-house" queries, it may be sufficient to use HttpProxy instead of ScriptTagProxy, but as my JS experience is limited I can't say what is better and/or faster
What I can say is that it works nice, here's my Store: this.store = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({ url:'get-grid.php' }), reader: this.reader, remoteSort: true }); |
#5
02-19-2007, 01:11 PM
|
Yeah the data api has changed quite a bit. There are shortcuts though (not being used there). This code:
// define the "Topic" record, mapping json data to record fields var Topic = Ext.data.Record.create([ {name: 'title', mapping: 'topic_title'}, {name: 'author', mapping: 'username'}, {name: 'totalPosts', mapping: 'topic_replies', type: 'int'}, {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'}, {name: 'lastPoster', mapping: 'user2'}, {name: 'excerpt', mapping: 'post_text'} ]); // create reader that reads into Topic records var reader = new Ext.data.JsonReader({ root: 'topics', totalProperty: 'totalCount', id: 'topic_id' }, Topic); // create reader that reads into Topic records var reader = new Ext.data.JsonReader({ root: 'topics', totalProperty: 'totalCount', id: 'topic_id' }, [ {name: 'title', mapping: 'topic_title'}, {name: 'author', mapping: 'username'}, {name: 'totalPosts', mapping: 'topic_replies', type: 'int'}, {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'}, {name: 'lastPoster', mapping: 'user2'}, {name: 'excerpt', mapping: 'post_text'} ]); Although it looks complex, in the end it can be made to look much easier by combining everything in one statement if you wanted to: // create the Data Store var ds = new Ext.data.Store({ // load using script tags for cross domain proxy: new Ext.data.ScriptTagProxy({ url: 'http://www.yui-ext.com/forum2/topics-remote.php' }), // let it know about the reader reader: new Ext.data.JsonReader({ root: 'topics', totalProperty: 'totalCount', id: 'topic_id' }, [ {name: 'title', mapping: 'topic_title'}, {name: 'author', mapping: 'username'}, {name: 'totalPosts', mapping: 'topic_replies', type: 'int'}, {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'}, {name: 'lastPoster', mapping: 'user2'}, {name: 'excerpt', mapping: 'post_text'} ]), // turn on remote sorting remoteSort: true }); |
#6
02-19-2007, 01:34 PM
|
I'm getting an error I haven't gotten before with grid 1.0. It says invalid label in firebug and it points to my return result php page.
My resultset is: {"ResultSet":[{"index":1,"Subject":" network key","Sender":"James Asher <jasher@scalix.xteconline.com>","Recipient":"Kevin Jordan <kevin.jordan@xteconline.com>","Date":"Tue, 30 May 2006 15:23:09 -0500"}],"totalCount":311} var Grid1 = { init: function() { this.mbox = "INBOX"; this.Mail = Ext.data.Record.create([ {name:"Subject",mapping:"mySubject"}, {name:"Sender",mapping:"mySender"}, {name:"Recipient",mapping:"myRecipient"}, {name:"Date",mapping:"myDate"} ]); this.reader = new Ext.data.JsonReader({ root: 'ResultSet', totalProperty: 'totalCount', id: 'index' },this.Mail); this.ds = new Ext.data.Store({ proxy: new Ext.data.ScriptTagProxy({ url: 'mailquery.php' }), reader:this.reader, remoteSort:true }); this.ds.setDefaultSort('Date', 'desc'); this.cm = new Ext.grid.ColumnModel([ {id:"mySubject",header:"Subject",width:400}, {id:"mySender",header:"Sender",width:100}, {id:"myRecipient",header:"Recipient",width:100}, {id:"myDate",header:"Date",width:100} ]); this.grid = new Ext.grid.Grid('mailgrid',{ds:this.ds,cm:this.cm,selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),enableColLock:false}); // make the grid resizable, do before render for better performance this.rz = new Ext.Resizable('mailgrid', { wrap:true, minHeight:100, pinned:true, handles: 's' }); this.rz.on('resize', this.grid.autoSize, this.grid); // render it this.grid.render(); this.gridFoot = this.grid.getView().getFooterPanel(true); // add a paging toolbar to the grid's footer this.paging = new Ext.PagingToolbar(this.gridFoot, this.ds, {pageSize: 25}); this.ds.load({params:{page:1, pageSize:25,mailbox:this.mbox}}); }, onLoad: function() { this.loaded = true; } } |
#7
02-19-2007, 01:40 PM
|
Like Belgabor said, you want to lose the ScriptTagProxy unless you are set up for it an calling cross domain. Switch to HttpProxy and see what happens.
|
#8
02-19-2007, 01:47 PM
|
|
Quote:
Removing the nested layout for now, my grid also doesn't seem to be getting populated and the page number is NaN of 13. |
#9
02-19-2007, 02:11 PM
|
The eval'd responseText seems to be an object with objects underneath it with my values inside.
|
#10
02-19-2007, 02:38 PM
|
Got it sorted out for the most part, but I still get weird page numbering, like instead of page 1 of 16, I get page 1.05 of 16. Is there any reason page and pageSize aren't getting passed automatically anymore and we're forced to use start and limit as params?
Edit: Apparently the PagingToolbar is supposed to take care of that. |
发表评论
-
jquery dual list 插件
2010-12-21 17:24 2344In my work, I came across the n ... -
Start PageIndexHistoryLast Change
2010-12-15 00:22 997The specifications should provi ... -
ajax upload
2010-11-19 13:22 0ajax upload The following cri ... -
兼容IE和FF获取Referer的JS方法
2010-11-11 10:11 4433众所周知,我们web开发人员痛恨IE浏览器,因为IE不支持标准 ... -
jQuery优化
2010-09-16 08:30 5474之前,我们减少字节数和请求次数以及加载顺序以使页面加载的更快。 ... -
jQuery add table row
2010-08-23 13:39 0The approach you suggest is not ... -
Add and Remove items with jQuery
2010-08-23 13:25 0Add and Remove items with jQuer ... -
extjs和struts、json的整合
2009-08-13 09:52 4491使用extjs配合struts的MVC架构是目前流行的做法,两 ... -
extra 1px space in dialog handle style - Ext JS
2009-04-20 23:33 1556Im developing a new style and h ... -
Grid - Custom header renderer? - Ext JS
2009-04-20 23:33 2042Is it possible to create a cust ... -
Inputs to DatePicker - Ext JS
2009-04-20 23:33 2139I thought I had read that you c ... -
dateFormat with timezone - Ext JS
2009-04-20 23:33 3567If I create JSON data on server ... -
How to use Ext.each? - Ext JS
2009-04-20 23:33 4457I'm trying to use Ext.each. It ... -
afteredit event ... new value? - Ext JS
2009-04-20 23:33 1489the new value is not set before ... -
problem qith iframe's - Ext JS
2009-04-20 23:33 1115I want to have dialogs and wher ... -
[Grid] Ext.data documenation - Ext JS
2009-04-20 23:33 1447I'm porting my grids to use the ... -
Last column to auto-adjust - Ext JS
2009-04-20 23:33 2681I can't see that this is curren ... -
Tree non-async creation "bug" - Ext JS
2009-04-20 23:32 2375When building a tree without us ... -
Bug - reload method of AsyncTreeNode - Ext JS
2009-04-20 23:32 1987Happens when the tree config o ... -
Minor grid paging toolbar issues - Ext JS
2009-04-20 23:32 1494When a grid toolbar is displaye ...
相关推荐
json-lib-ext-spring-1.0.2.jarjson-lib-ext-spring-1.0.2.jarjson-lib-ext-spring-1.0.2.jar
php-json-ext源码包,先确认系统上是否安装了php-devel 软件,如果没有安装就必须安装,否则,不能编译安装php-dson-ext!
spketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-ext-2.1.mxpspketdwcs-...
Visual Studio Code上搜不到插件Auto.js-Pro-Ext hyb1996
解压即可得到jcifs-ext-0.9.4.jar, java环境资源,jdk1.6及以上
bcprov-ext-jdk15on-1.68.jar
Android SDK中platforms下的android-34-ext8 自行解压
支持php5.3.3的php-js-ext 0.1.2扩展
Openlayers扩展插件ol-ext ,2022年4月版本
前端开源库-style-ext-html-webpack-pluginStyleExtHTML Webpack插件,通过启用内嵌样式增强HTML Webpack插件功能。
1.下载 bcprov-ext-jdk15on-160.jar,复制到jdk_home\jre\lib\ext 2.配置bcprov,在 jdk_home\jre\lib\security\目录中找到 java.security 在内容增加一行 security.provider.11=org.bouncycastle.jce.provider....
jcifs-ext-0.9.4.jar/jcifs-1.3.3.jar 单点登陆 解决maven仓库有jar包但是maven程序无法下载仓库jar包
bcprov-ext-jdk16-1.45.jar资源包 ,在进行JAVA的ECC椭圆算法调用时,需要用到的jar包
xml-apis-ext.jar,hightcharts导出图片是解决乱码需要用到的一个包
Jenkins插件email-ext
2.将下载的两个JAR文件复制到:JDK安装目录\jre\lib\ext下,例如我的就是D:\Program Files (x86)\java\JDK1.6\jre\lib\ext 3.打开java.security文件:在JDK安装目录\jre\lib\security下的java.security文件。
哈工大版本,for pytorch
哈工大版本,for pytorch
bcprov-ext-jdk15on-1.54.jar和bcprov-jdk15on-1.54.jar压缩文件