简体   繁体   English

ExtJS网格分页不起作用

[英]ExtJS Grid Pagination Not Working

I am new to extjs and trying to get the grid pagination working on for a project. 我是extjs的新手,正在尝试为项目进行网格分页。

Can anyone tell me if there is an online tutorial to setup pagination for extjs grid? 谁能告诉我是否有在线教程来设置extjs网格的分页? I am getting the records for the first page but no on clicking the next button. 我正在获取第一页的记录,但没有单击下一步按钮。

It would be great if some one can code or specify what code changes are required to get the next set of results. 如果有人可以编码或指定需要更改哪些代码才能获得下一组结果,那将是很好的。

Any help will be really appreciated!! 任何帮助将不胜感激!

For an example check out http://docs.sencha.com/ext-js/4-1/#!/example/grid/paging.html 有关示例,请访问http://docs.sencha.com/ext-js/4-1/#!/example/grid/paging.html

The service that example uses can be seen here: http://www.sencha.com/forum/topics-browse-remote.php?&page=3&start=100&limit=50&sort=lastpost&dir=DESC 可以在此处看到示例使用的服务: http : //www.sencha.com/forum/topics-browse-remote.php?&page=3&start=100&limit=50&sort= lastpost&dir= DESC

Note that Ext JS Paging Toolbar adds the page, start, limit and sort params to the URL. 请注意,Ext JS Paging工具栏将页面,开始,限制和排序参数添加到URL。

Your java code will need to reference these and use them in your SQL query. 您的Java代码将需要引用它们,并在SQL查询中使用它们。

A Spring controller might have something like this which will allow you to access the query params later in the method: Spring控制器可能具有类似这样的内容,它将允许您稍后在方法中访问查询参数:

@RequestMapping(value = "/listTopics", method = RequestMethod.GET)
public ModelAndView listTopics(
        @RequestParam(value = "start", required = false, defaultValue = "0") Integer start
        @RequestParam(value = "limit", required = false, defaultValue = "10") Integer limit
        ) {

... } ...}

Also see this full java example with working demo: http://www.mysamplecode.com/2012/02/extjs-grid-cell-editing-tutorial-2.html 另请参阅带有工作演示的完整Java示例: http : //www.mysamplecode.com/2012/02/extjs-grid-cell-editing-tutorial-2.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM