Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [nebula-dev] Virtual NatTable

> Yes - NatTable basically always operates in 'virtual' mode. It doesn't make
> any assumptions that the entire data set will be in memory and will only ask

I assume that this is only for unfetched data? i.e. the rows that the
user did not scroll to yet. Is there a way to unload data that gets
scrolled out of the viewport?

How you load and unload data is up to you - this all happens under the IDataProvider API so NatTable doesn't really care how you do it. We don't have a canned implementation in NatTable for this right now so it's up to you to implement this yourself and you can decide to handle this however you like.

If you want to evict data when it scrolls out of view, in theory you could register a layer listener to the viewport layer to listen for scroll events and react accordingly. This isn't something I've tried doing myself however, so I'm not exactly sure if we have all the event hooks needed for this to work. I'm not altogether sure that's the best way to do it either; it may be better to have a data buffer that is somewhat larger than the viewport area (you generally only have a few dozen rows on screen at any given time - expiring data every time you move the viewport is likely not very efficient) and expire least recently used items.

Are you using the proxy strategy when getting the row count (i.e.
create getRowCount() empty rows in the table or is this calculated on
the fly)?

Not from NatTable's perspective, no. NatTable just needs to know the row count to size the scrollbars correctly; it doesn't care if all of the rows are actually created or not. You can decide when and how to create individual rows in your implementation of the data provider.

Edwin


Back to the top