Dynamic coloring a result [message #871200] |
Fri, 11 May 2012 08:04  |
Eclipse User |
|
|
|
Hello,
I have a xml file which contains in one of its parameters an item and a color value in hexadecimal format.
And I want to List the items, but I would like that the font color of each item was the color of the value which results in color colum.
Example:
....
<myitem color= "#0080ff"> myitemNameA </myitem>
<myitem color= "#990000"> myitemNameB </myitem>
I retrive the columns ItemName and ItemColor (OK), and i want to generate the following output:
Items List
Name Other item properties
myitemNameA
myitemNameB
But i can't find hoe to place an expression in the color font.
Is it possible to do this? I could use styles however I had to create a style for each possible colors (it wold take me some hours,lol)
Is there any solution out there?
|
|
|
Re: Dynamic coloring a result [message #871269 is a reply to message #871200] |
Fri, 11 May 2012 13:26  |
Eclipse User |
|
|
|
Use an onCreate script on the data item with something like the following:
//get the column binding for the font color
var fc = this.getRowData().getColumnValue("FontColor");
this.getStyle().color= fc;
Jason
On 5/11/2012 8:04 AM, Filipe Apóstolo wrote:
> Hello,
>
> I have a xml file which contains in one of its parameters an item and a
> color value in hexadecimal format.
>
> And I want to List the items, but I would like that the font color of
> each item was the color of the value which results in color colum.
>
> Example:
> ....
> <myitem color= "#0080ff"> myitemNameA </myitem>
> <myitem color= "#990000"> myitemNameB </myitem>
>
> I retrive the columns ItemName and ItemColor (OK), and i want to
> generate the following output: Items List
> Name Other item properties
> myitemNameA
> myitemNameB
>
> But i can't find hoe to place an expression in the color font.
>
> Is it possible to do this? I could use styles however I had to create a
> style for each possible colors (it wold take me some hours,lol)
>
> Is there any solution out there?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03826 seconds