ext分页问题 好好看看API文档里面肯定有详细的介绍!我才开始看EXT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /ExtPractise/MyPages/list.htm 这个页面的内容是什么啊?JsonStore要求返回数据是 JSON 格式的数据如果和http://extjs.com/forum/topics-browse-remote.php返回的内容一样就可以啊返回的格式应该是 {'totalCount':100,'topics':[{'id':1,title:'名称',bh:2,submittime:'208-2-2',submitname'name'}]} 回复3L,4L如果直接运行list.htm,输出的和http://extjs.com/forum/topics-browse-remote.php一样因为我访问了http://extjs.com/forum/topics-browse-remote.php,把他输出的内容拷进了list.htmlist.htm连html标签都没有,就是作为一个数据页而存在的 http://extjs.com/forum/topics-browse-remote.php 返回的东西好乱你在list.htm 直接写{'totalCount':100,'topics':[{'id':1,title:'名称1',bh:'bh1',submittime:'2008-2-2',submitname'name1'},{'id':2,title:'名称2',bh:'bh2',submittime:'2008-2-2',submitname'name2'}]} 这个应该是可以的 ,正确格式的json数据应该没错 回6L,错误还是和以前一样 是不是我代码的问题?我发部分代码吧,其他没用的就不发了var store = new Ext.data.JsonStore({ root: 'topics', fields: [ 'id', 'title', 'bh', 'submittime','submitname' ], totalProperty: 'totalCount', idProperty: 'id', remoteSort: true, proxy: new Ext.data.ScriptTagProxy({ url:'/ExtPractise/MyPages/list.htm' })});Ext.onReady(){.......var Colu = new Ext.grid.ColumnModel //这个类应该和他的字面意义差不多,就是列模板 ( //这里的表头必须和上面的JsonReader.fields里的列一一对应 [ //header是表头的文本 //width就是列宽 //sorttable:true是开启表格的排序选项,排序的实现代码还是要自己写 //dataIndex是列的数据源 {header:"序号",width:60,sortable:true,dataIndex:'id'}, {header:"标题",width:180,sortable:true,dataIndex:'title'}, {header:"编号",width:100,dataIndex:'bh',sortable:true}, {header:"提交时间",width:120,dataIndex:'submittime',sortable:true}, {header:"发布人",width:120,dataIndex:'submitname',sortable:true} ] ); var grid = new Ext.grid.GridPanel ( { //对GridPanel进行配置 renderTo:'div_data',//这里要配置GridPanel在哪个容器里面,grid是容器的ID,ID为grid的容器在MyExt/Main.js里面定义了。 height:420, store: store, stripeRows: true, width:795, cm:Colu, //配置表头 trackMouseOver:true, //鼠标特效 loadMask: true, //Ajax的Loading.... autoShow : false, //??? autoScroll: true, //??? //GridPanel的头部 tbar: [ '查询 ', {xtype:'textfield',width:170,id:'title',name:'title'}, {text:'搜索',iconCls:'search',handler:searchByTitle},{xtype:'tbseparator'}, {text:'添加',iconCls:'add'} ], bbar: new Ext.PagingToolbar({ pageSize: 5, store: store, displayInfo: true, displayMsg: '当前显示{0} - {1} 条记录 /共 {2}条记录', emptyMsg: "无显示数据" }) } )store.load( { params:{start:0, limit:5} //传参:参数名为parame1,值为变量title的值 } ); 晕死!Ext.onReady(){ ????我这里都这样写的 Ext.onReady(function(){。}); 不是那里的原因 我的...已经把function省略了现在改用HttpProxy了 ===================求正则表达式=============================== 想实现隐藏栏功能,不知道为什么无法实现?? 网页中&#nnnnn;其中nnnnn是数字,这样的有什么作用 javascript调用ocx控件时的参数传递问题 javascript参数传递 js对象操作 求一用JavaScript编写的时间输入界面! 点击下载的问题 框架的问题!望高手不吝赐教! 请问javascript能做email的发送程序吗? 关于open打开窗体问题 求助~~~js横向滚动图片如何能让速度非常快?现在调整到1了还达不到效果啊~
如果直接运行list.htm,输出的和http://extjs.com/forum/topics-browse-remote.php一样
因为我访问了http://extjs.com/forum/topics-browse-remote.php,把他输出的内容拷进了list.htm
list.htm连html标签都没有,就是作为一个数据页而存在的
你在list.htm 直接写{'totalCount':100,'topics':[{'id':1,title:'名称1',bh:'bh1',submittime:'2008-2-2',submitname'name1'},{'id':2,title:'名称2',bh:'bh2',submittime:'2008-2-2',submitname'name2'}]}
这个应该是可以的 ,正确格式的json数据应该没错
我发部分代码吧,其他没用的就不发了
var store = new Ext.data.JsonStore({
root: 'topics',
fields: [
'id', 'title', 'bh', 'submittime','submitname'
],
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
proxy: new Ext.data.ScriptTagProxy({
url:'/ExtPractise/MyPages/list.htm'
})
});
Ext.onReady(){
.......
var Colu = new Ext.grid.ColumnModel //这个类应该和他的字面意义差不多,就是列模板
(
//这里的表头必须和上面的JsonReader.fields里的列一一对应
[
//header是表头的文本
//width就是列宽
//sorttable:true是开启表格的排序选项,排序的实现代码还是要自己写
//dataIndex是列的数据源
{header:"序号",width:60,sortable:true,dataIndex:'id'},
{header:"标题",width:180,sortable:true,dataIndex:'title'},
{header:"编号",width:100,dataIndex:'bh',sortable:true},
{header:"提交时间",width:120,dataIndex:'submittime',sortable:true},
{header:"发布人",width:120,dataIndex:'submitname',sortable:true}
]
);
var grid = new Ext.grid.GridPanel
(
{
//对GridPanel进行配置
renderTo:'div_data',//这里要配置GridPanel在哪个容器里面,grid是容器的ID,ID为grid的容器在MyExt/Main.js里面定义了。
height:420,
store: store,
stripeRows: true,
width:795,
cm:Colu, //配置表头
trackMouseOver:true, //鼠标特效
loadMask: true, //Ajax的Loading....
autoShow : false, //???
autoScroll: true, //???
//GridPanel的头部
tbar:
[
'查询 ',
{xtype:'textfield',width:170,id:'title',name:'title'},
{text:'搜索',iconCls:'search',handler:searchByTitle},{xtype:'tbseparator'},
{text:'添加',iconCls:'add'}
],
bbar: new Ext.PagingToolbar({
pageSize: 5,
store: store,
displayInfo: true,
displayMsg: '当前显示{0} - {1} 条记录 /共 {2}条记录',
emptyMsg: "无显示数据"
})
}
)
store.load(
{
params:{start:0, limit:5} //传参:参数名为parame1,值为变量title的值
}
);
Ext.onReady(){ ????
我这里都这样写的 Ext.onReady(function(){。});
我的...已经把function省略了
现在改用HttpProxy了