Dojo DataGrid 非常慢
我有一个从 XMLStore 读取数据的 DataGrid。 DataGrid 中有大约 2200 行。每次滚动表格时,都需要几秒钟才能显示数据。似乎一次只检索几行(20-25)。有没有办法一次检索所有行?
I have a DataGrid that reads from a XMLStore. There are about 2200 rows in the DataGrid. Every time I scroll the table, it takes a couple of seconds to show the data. It seems like only a few rows (20-25) are retrieved at a time. Is there a way to retrieve all the rows at once?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要更改 rowsPerPage 的默认值,这可以通过编程方式或通过标记来完成。请参阅此处的示例:http ://www.sitepen.com/blog/2008/10/22/new-features-in-dojo-grid-12/
不过,请注意:可能会一次获取 2200 行数据不会给你你想要的表现。我建议尝试使用大于默认值 25 但小于整个记录集的 rowsPerPage 值(100 似乎是一个不错的起点),直到找到您满意的值。
You need to change the default value for rowsPerPage, which can be done both programmatically and via markup. See here for examples of each: http://www.sitepen.com/blog/2008/10/22/new-features-in-dojo-grid-12/
A word of caution, though: fetching 2200 rows of data at once time is likely not going to give you the performance you want. I'd suggest experimenting a bit with rowsPerPage values larger than the default of 25, but smaller than your entire recordset (100 seems like a good place to start), until you find a value you're happy with.