B4J Question TableView and first row

besoft

Active Member
Licensed User
Longtime User
I need help.
Can the first row be frozen in the tableview?
 

stevel05

Expert
Licensed User
Longtime User
There is no such function in javafx. Out of curiosity, I created a custom view which overlays a duplicate of the first row data in a pane where the first row should be if the scroll is not at 0. It is in the attached file if you want to try it.

It is far from a finished customview, it only currently supports text and numbers (no nodes) although it should be fairly straight forward to duplicate or create an image from nodes if that is required and add it to the overlay pane.

It uses a fixed row height and multiple listeners to track the scroll and changes to the data.

Depends on JavaObject and CSSUtils.
 

Attachments

  • FixedRowTableView.zip
    4.1 KB · Views: 197
Upvote 0

besoft

Active Member
Licensed User
Longtime User
Thanks for the reply,
The example works, but not expected. When sorting, the line moves to the bottom.
I have an idea of how to do otherwise, but I have not had time to try.

Thanks anyway.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you sort the tableview, it will presumably have a new first row with different values. That will then appear at the top. If you don't want to include the first row in a sort, you will have to write a sort routine to do that.
 
Upvote 0

besoft

Active Member
Licensed User
Longtime User
This is also an option, I will try it. The first line contains text fields for adding records and editing records.


thx
 
Upvote 0
Top