首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

ext.paginggridpanel后台代码如何写。

2012-02-02 
ext.paginggridpanel后台代码怎么写。 - Web 开发 / Ajax如题,希望高手们能给个详细的代码。。谢谢。。[解决办

ext.paginggridpanel后台代码怎么写。 - Web 开发 / Ajax
如题,希望高手们能给个详细的代码。。谢谢。。

[解决办法]

JScript code
var store = new Ext.data.JsonStore({        root: 'topics',//根        totalProperty: 'totalCount',//总页数        idProperty: 'threadid',        remoteSort: true,        fields: [            'title', 'forumtitle', 'forumid', 'author',            {name: 'replycount', type: 'int'},            {name: 'lastpost', mapping: 'lastpost', type: 'date', dateFormat: 'timestamp'},            'lastposter', 'excerpt'        ],        // load using script tags for cross domain, if the data in on the same domain as        // this page, an HttpProxy would be better        proxy: new Ext.data.ScriptTagProxy({            url: 'http://extjs.com/forum/topics-browse-remote.php'        })    });    store.setDefaultSort('lastpost', 'desc');/**后台code返回数据格式:{totalCount:"总页数"topics:[{和fields中的数据对应}]}*/var pagingBar = new Ext.PagingToolbar({        pageSize: 25,        store: store,        displayInfo: true,        displayMsg: 'Displaying topics {0} - {1} of {2}',        emptyMsg: "No topics to display",                items:[            '-', {            pressed: true,            enableToggle:true,            text: 'Show Preview',            cls: 'x-btn-text-icon details',            toggleHandler: function(btn, pressed){                var view = grid.getView();                view.showPreview = pressed;                view.refresh();            }        }]    });store.load({params:{start:0, limit:25}});//从后台获得参数,从start哪页开始显示,limit每页显示多少条记录参考:http://blog.csdn.net/dwj520/archive/2009/12/12/4994411.aspxhttp://hi.baidu.com/%CB%B9%CE%C4%B5%C4%BB%D2%C9%AB%BF%D5%BC%E4/blog/item/ebeae13510c46d80a71e127a.html 

热点排行