Home » Eclipse Projects » Remote Application Platform (RAP) » Change tree / table header background and foreground color
| | |
Re: Change tree / table header background and foreground color [message #1787222 is a reply to message #1787189] |
Tue, 22 May 2018 09:48 |
|
Hi Nicola,
CSS styling isn't at all in contrast with dynamic change of background and foreground, even for table headers.
Just define different CSS for your UI status, e.g.
TableColumn {
color: #0000FF;
background-image: gradient(
linear, left top, left bottom,
from( #ff0000 ),
to( #ff0000 )
);
}
TableColumn.other {
color: #00FF00;
background-image: gradient(
linear, left top, left bottom,
from( #0000FF ),
to( #0000FF )
);
}
Then, when you want to change it, do for instance:
TableColumn[] columns = table.getColumns();
columns[2].setData( RWT.CUSTOM_VARIANT, "other" );
it works (just tested)
HTH
Vincenzo
|
|
| |
Re: Change tree / table header background and foreground color [message #1787293 is a reply to message #1787289] |
Wed, 23 May 2018 09:05 |
|
Hi Nicola,
I can assure you that the snippets in my previous post are indeed working, at least if I understood right your needs.
Let me show you.
This is how the table header appears at first
that's because of the base CSS is the following
TableColumn {
color: #0000FF;
background-image: gradient(
linear, left top, left bottom,
from( #ff0000 ),
to( #ff0000 )
);
}
then, when I click on a button, I do this programmatically
TableColumn[] columns = table.getColumns();
columns[3].setData( RWT.CUSTOM_VARIANT, "other" );
and that's what happens immediately
thanks to the following CSS
TableColumn.other {
color: #00FF00;
background-image: gradient(
linear, left top, left bottom,
from( #0000FF ),
to( #0000FF )
);
}
If that's not happening to you, the only reason I can think of is that you aren't handling the ServerPushSession (start/stop). In this case, try to do start it, e.g. when creating the composite, with:
ServerPushSession pushSession = new ServerPushSession();
pushSession.start();
(although at some point you should call also .stop())
Let me know what's not working for you.
HTH
Vincenzo
|
|
| |
Goto Forum:
Current Time: Tue Apr 23 08:10:18 GMT 2024
Powered by FUDForum. Page generated in 0.03289 seconds
|