@Kevinkun : I solved it now by still using AnyTableViewer, but I am using now SetStyleSheet (instead of SetStyle) and it works great. I post all my CSS content into it, like e.g.:
My screen consists of a huge vertical scroll arragement, therefor I think the whole layout with the tableviewer including the header row just scrolls "away"
I assume your example is only feasible if the screen and/or underlying arrangement are NOT scrollable and tableview-layout IS scrollable? Could that be?
A fixed height for the VA containing the tableviewer, less than the height of the tableview, to make it scroll.
When testing with emulator on computer, and scrolling with the mouse wheel, will not scroll past the tableview, until it has scrolled the tableview (as expected...). Probably similar behaviour with a finger.
@Kevinkun : I use in my project the same tableviewer in the same layout. At first, the table gets loaded at app startup with ~50 lines and displayed perfectly. Then, after a click on a button, the data is much less, but as I said, i pass that data into the same tableviewer in the same layout. BUT the room that is reserved on the screen for the table is then still the same as when the app loads. So reducing the amount of lines does not lead to a smaller hight of the layout. I do make a new INIT at button.click, but does not change the above behaviour.
Can you please explain how I can achieve that? Is INIT not the right step to do so? Thank you!
KR, Oli
I have replicated what you reported, only if you set the container's height as automatic.
Maybe I can add a runjs function, you can get the height of the table by js, then adjust the container's height if needed.
Hi guys (@TIMAI2 and @Kevinkun).
ClearTable sounded like a good idea, but it did not help unfortunately.
Yes, my container (an vertical arrangement) is set to height=automatic.
After reducing the amount to rows to be displayed, space is not adjusted to the new height.
But I would not see any other alternative than height=automatic.
And to display the table in a VA is also correct, right?
You are right! Works for my now also with .Init.
Previously, I tried to make the init somewhere else in my loop and there it did not work strangly.
But now it is fine, even with height=automatic.
Thanks!
I think your misunderstanding is that you want to use "list" like a database or like a table, but a list only can hold 1 set of values, comma-seperated. One "row" basically.
I think, you should start using a database like TinyDB to store your entries.
Then loop over that database to read those entries and move them to the Tableviewer.