简体   繁体   English

Ext JS 6.2中的BufferedStore和BufferedRenderer插件有什么区别

[英]What is the difference between the BufferedStore and the BufferedRenderer plugin in Ext JS 6.2

I'm having a heck of time getting ExtJS 6.2 to work with infinite scrolling. 我花了很多时间让ExtJS 6.2与无限滚动一起工作。 I've been through their docs and examples many times and I can't get it to work. 我已经看过他们的文档和示例很多次了,但我无法使其正常工作。 I'm wondering if I just am misunderstand how the BufferedStore works and how is it different from the BufferRenderer plugin. 我想知道是否只是误解了BufferedStore的工作方式以及它与BufferRenderer插件的不同之处。

Can someone please explain the differences between the two and which one would I use to get infinite scrolling to work with a oData Rest API using their Ext.grid.Panel class. 有人可以解释一下两者之间的区别吗?我可以使用哪一个来使用其Ext.grid.Panel类与oData Rest API进行无限滚动。

You'll need to use only the BufferedStore . 您只需要使用BufferedStore The BufferedRenderer is instantiated automatically and applied to all grids. BufferedRenderer会自动实例化并应用于所有网格。

BufferedStore controls the way the data store loads data. BufferedStore控制数据存储加载数据的方式。 Instead of grabbing the entire data set, it loads data in 'pages' as required eg. 它没有获取整个数据集,而是根据需要将数据加载到“页面”中。 when the data is requested. 请求数据时。 BufferedRenderer works on the grid view side, it basically renders a subset of grid rows - rather than rendering everything thats in the store connected to the grid. BufferedRenderer在网格视图侧工作,它基本上呈现网格行的子集-而不是呈现连接到网格的商店中的所有内容。

In the old days of ExtJS :) - grids would load everything from the store, so potentially you might have thousands of rows. 在ExtJS :)的旧时代,网格会加载存储中的所有内容,因此可能会有成千上万的行。 These would not be visible of course you would only see them when you scroll, but they were in the dom hence it would take time. 这些当然是不可见的,您只有在滚动时才能看到,但是它们在dom中,因此需要一些时间。

If you have a lot of data in the grid, you usually use both, but I have had situations where I want everything in the store, but not in the grid - eg if I need to sort or manipulate data in the store prior to rendering. 如果网格中有很多数据,通常会同时使用两者,但是在某些情况下,我需要存储中的所有内容,而不是网格中的所有东西-例如,如果我需要在渲染之前对存储中的数据进行排序或操作。

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

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