将datagrid设置为每页只显示5行 [英] Set datagrid to show just 5 rows per page

查看:296
本文介绍了将datagrid设置为每页只显示5行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DOJO进行数据网格呈现

I am using DOJO for data grid presentation

 <div id="grid_log" dojoType="dojox.grid.DataGrid" store="log"   structure="window.layout_log" queryOptions="{deep:true}" query="{}" clientSort="true" rowsPerPage="5"> </div>

但问题是grid_log每页不显示5行。这个标签有什么问题?为什么忽略rowsPerPage =5?

but problem is that grid_log doesn't show just 5 rows per page. What is wrong with this tag ? Why ignores rowsPerPage="5" ?

推荐答案

看起来像rowsPerPage值不是查看的页面 - 但是而是虚拟页面。也就是说,网格只会一次呈现自身的一部分(为了提高非常大的数据集的性能),并且rowsPerPage值用于确定一次呈现的行数。

It's look like the rowsPerPage value isn't pages that are "viewed" - but rather, "virtual" pages. That is, the grid only renders portions of itself at a time (in order to improve performance for very large data sets) - and the rowsPerPage value is used to determine how many rows to render at a time.

如果您滚动到网格上的位于渲染页面之外的位置,它将按需呈现。

If you scroll to a position on the grid that it outside the rendered pages, it will render it on demand.

如果您正在显示超过5行(由于您在网格上设置的高度) - 然后将rowsPerPage设置为5将仅使一次可以分批呈现5行的可见部分。即将在start = 0和count = 5之间调用您的数据存储区的查询,另外一个查询用start = 5和count = 5等发送,直到所有可见的行被呈现为止。

If you are displaying more than 5 rows (due to the height that you have set on your grid) - then setting rowsPerPage to 5 will just cause the viewable portion to be rendered in batches of 5 rows at a time. i.e. there will be a query called to your datastore with start=0 and count=5, and another query sent with start=5 and count=5, etc - until all the visible rows are rendered.

但是,您可以在此页面上看到 - 它是网格的示例分页。可能会帮助你。

However you can see on this page - it is example of grid with paging. May be it helps you.

这篇关于将datagrid设置为每页只显示5行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆