| When to apply the DefaultNatTableStyleConfiguration? [message #990462] |
Wed, 12 December 2012 10:31  |
Alex Kipling Messages: 211 Registered: July 2012 |
Senior Member |
|
|
I did
DefaultNatTableStyleConfiguration defaultNatTableStyleConfiguration = new DefaultNatTableStyleConfiguration();
defaultNatTableStyleConfiguration.hAlign = HorizontalAlignmentEnum.LEFT;
natTable.addConfiguration(defaultNatTableStyleConfiguration);
natTable.configure();
but it did not work.
How would I apply the DefaultNatTableStyleConfiguration ?
|
|
|
|
|
| Re: When to apply the DefaultNatTableStyleConfiguration? [message #990585 is a reply to message #990580] |
Thu, 13 December 2012 04:58   |
Dirk Fauth Messages: 524 Registered: July 2012 |
Senior Member |
|
|
Hi Alex,
this is some code I use and which works fine:
NatTable natTable = new NatTable(parent, layer, false);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration() {
{
vAlign = VerticalAlignmentEnum.TOP;
hAlign = HorizontalAlignmentEnum.LEFT;
}
});
natTable.configure();
Are you sure that you don't overwrite the styling by using some conditional styling based on labels?
You can for example add the following configuration to your NatTable instance, which will enable a context menu that allows you to check which labels are attached to your cell.
natTable.addConfiguration(new DebugMenuConfiguration(natTable));
Also you don't need to add the DefaultNatTableStyleConfiguration to both, the GridLayer and the NatTable. NatTable should be enough.
The only other thing that might cause an issue could be the ConfigRegistry instance. Are you creating new one at the beginning? In this case you would need to set it back to the NatTable of course. Otherwise the NatTable will create its own one, and then your configuration and your instantiation of NatTable won't use the same one.
Hope that helps,
Dirk
Oh, and regarding your question, if you want to retrieve a value out of the ConfigRegistry, use getConfigAttribute(). UTSL (always wanted to use this )
IConfigRegistry reg = natTable.getConfigRegistry();
reg.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.NORMAL);
[Updated on: Thu, 13 December 2012 05:02] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01702 seconds