Flex AdvancedDataGrid 缓存记录
我有一个绑定到 ArrayCollection 的 AdvancedDataGrid(ADG)。 ArrayCollection 是从我的 Oracle 数据库填充的。 现在,我在数据库中的记录有数百万条,有时,根据用户最坏情况的标准,我可以获得大约 10,000 条记录。 现在,由于该集合绑定到 ADG,它尝试同时呈现所有记录,因此应用程序变得缓慢。
我需要知道的是,是否有任何方法可以将数据库中的所有结果缓存在 ArrayCollection 中,然后根据网格的滚动每 100 条记录进行渲染。 即仅在需要显示时才渲染。 因此,我不需要在数据库中查询每 100 条记录,而是需要在需要显示时渲染每 100 条记录。
有什么办法可以做到这一点吗?
谢谢 :)
I have an AdvancedDataGrid(ADG) bound to an ArrayCollection. ArrayCollection is populated from my Oracle database. Now, the records I have in the database are in millions and sometimes, based on the worst case criteria by the user, I can get around 10,000 records. Now, as this collection is bound to the ADG, it tries to render all the records at the same time and hence the application becomes sluggish.
What I need to know is, if there is any way to cache all the result from the database in the ArrayCollection and then render every 100 records based on the scrolling of the grid. That is, render only when it is needed to be shown. So, instead of querying the database for every 100 records, I need to render every 100 records when they are needed to be shown.
Is there any way to do like this?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将数据加载到 ArrayCollection,然后使用另一个 ArrayCollection 来显示数据(您可能可以过滤原始 ArrayCollection 以仅显示 100 个,但这更简单)。
确保将“display”作为您的 ADG 的数据提供者。 如果你想聪明一点,可能有一种方法可以不必从 Display 中删除所有元素。
You can load your data to an ArrayCollection and then use another one to display the data (You could probably filter your original ArrayCollection to display just 100, but this is more straightforward).
Be sure to have "display" as your ADG's dataProvider. If you want to be clever, there is probably a way to not have to remove all the elements from Display.