VirtualizedFX table with big dataset #282
Replies: 6 comments 6 replies
-
|
Hello @stefanofornari
|
Beta Was this translation helpful? Give feedback.
-
|
Good morning. TableThe TableView has controls to set the sorting column(s) and filters. Plus indeed the items in the table rows. These are exposed through the properties items, filters, sorting. TableSourceA TableSource object provides the data to show in the table by binding the table's items property with source's page property. It supports filtering and sorting by binding filters and sorting. page acts as source for the table object while filters and sorting are sinks. ControllerThe Controller glues together the table view and the table source:
Controller can creates the table source or the table source can be provided with a setter. In the former case it can be used directly in the FXML, in the latter, FXMLLoader.load() needs be used with the controller factory. A builder can be provided to make it easier. SimpleTableSource and DBTableSourceWe can think of two basic implementations of TableSource. A simple one which basically reproduces the current behaviour and a version that uses a database table to get the data. SimpleTableSource
DBTableSource
|
Beta Was this translation helpful? Give feedback.
-
|
As a first step I added sort order functionality so that when I change the order data are fetched taking that into account. At the moment I am planning to do something like: |
Beta Was this translation helpful? Give feedback.
-
|
yep
Ste
…On Wed, Jan 11, 2023 at 9:08 PM Alessadro Parisi ***@***.***> wrote:
With the new VirtualizedFX?
—
Reply to this email directly, view it on GitHub
<#282 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKRAXZJ75DVHVYWJX5ON3WR4HK7ANCNFSM6AAAAAATT76XX4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
It looks like I ran into the first bug :) palexdev/VirtualizedFX#4 (comment) |
Beta Was this translation helpful? Give feedback.
-
|
OK, I have done a first step ahead. The table works pretty well. The design came out simpler than anticipated, as it basically binds the table items to the data set. Controlling the scroll as in #282 (comment) triggers fetching more data. I also easily added column sorting. For who interested here the relevant code: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I need to attach a TableView to a potentially big dataset (e.g. a database table). I have started with MaterialFX TableView but I can't go further because it is not designed for such use case. I tried to build a new one on my own, but the current version of MFX uses an old version of VirtualizedFX with a SimpleVirtualFlow object that is not any more in VirtualizedFX. I need something I can comfortably look into the code and debug.
I then had a look at VirtualizedFX and as far as I understand, it provides a much better implementation of a TableView with virtual flow. (great stuff, BTW!). Therefore I am now playing with VirtualizedFX.
The question: what's the best way to use a datasource that can provide ondemand data? I am thinking about something like that when I scroll down to the last row, the data source is fetched for more data. Is this use case supported already?
Many thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions