|
|
|
Re: When to apply the DefaultNatTableStyleConfiguration? [message #990585 is a reply to message #990580] |
Thu, 13 December 2012 09:58 |
Dirk Fauth Messages: 2902 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 10:02] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03665 seconds