rowsPerPage不能与dojox.grid.DataGrid一起使用

时间:2011-07-11 16:44:35

标签: dojo

目前我从我的Servlet获得了100条记录。

我想每页只显示20条记录,我正在使用dojox.grid.DataGrid,但仍显示所有100条记录 请帮忙。

<body class=" claro ">
        <span dojoType="dojo.data.ItemFileReadStore" jsId="store1" url="http://localhost:8080/Game/servlet/Hi"></span>

<table dojoType="dojox.grid.DataGrid" store="store1" rowsPerPage="20" rowSelector="20px"
   style="width: 100%; height: 500px;">
    <thead>
        <tr>
            <th width="150px" field="name">Namer3</th>
            <th width="150px" field="dept">Deptr3</th>
                    </tr>
    </thead>
</table>
</body>

1 个答案:

答案 0 :(得分:1)

我建议你开始使用QueryReadStore,并更改你的servlet以尊重作为帖子一部分的start和count参数。这将允许网格获取行1-20,然后在用户向下滚动时获取21-40,依此类推。

如果您希望告诉网格一次只渲染20行并等待其他行的滚动事件,则应该已经处理过了。我建议你仔细检查你的网格。最初应该使用值呈现20行,而后面的行应该在所有值中都有“...”,直到滚动到视图中。