I looked through most of the example classes, but I did't find an example where the data is filled in columnwise.
I really just want to display an execelsheet, as it is, in a table. Maybe the cells should be editable, but thats it. But I can't figure out how to learn this from the examples.
I think my needs can be achieved with a dataProvider?
the default cases we recognized with the NatTable is to show lists of objects. Of course there are multiple other use cases, but as they are quite special, there is no default implementation for these cases.
To show lists of objects, there are the ListDataProvider that is used together with a custom IColumnAccessor.
If you want to use another approach for loading data into a NatTable, e.g. columnwise, you need to implement your own IDataProvider. In this case you don't need an IColumnAccessor.
Thank you finally did it.
One more question:
when I create the natTable (in a (view)part) the scrollbars doesn't work at first. I need to resize the part to change that.
I already tried to call the redraw(), update() and layout() method on the parents of my view but it doesn't work.
Is this a natTable related problem or should I ask/look rather in another forum?
I also use the NatTable in a part, and I don't see an issue with the scrollbars. Maybe it is related to the layout manager you are using. Which layout manager are you using and how do you create your layout?
the issue seems to be related to the creation of your NatTable instance. You are setting the layer after creation and not on creating your NatTable. This should be possible tho, so this might be something to look at.
What you can do now is, if you want to leave your code as is, try to call dataTable.refresh() at the end of your setViewerInput().
But I would suggest to change your code to only change the input rather than the whole layer stack, as there is no change to the layer stack except the content. Without using GlazedLists for automatic eventing you would then still need to call refresh() on your NatTable instance to rerender.