:: Forum >> Version 1 >>

setting a color for a single cell

More information on this topic is available in the documentation section: /active.howto.style.grid/colors-fonts-etc.html.

Hi
How can I set the text or background color for a single cell ?

Will appreciate any help
Adi Katz
Tuesday, August 23, 2005
obj.getCellTemplate().setStyle("color", "red"); // all columns
obj.getCellTemplate(1).setStyle("color", "green"); // column-1
obj.getCellTemplate(2, 3).setStyle("color", "blue"); // column-2, row-3

Replace "color" with "background-color" for backgraound
Rick Villela
Thursday, November 10, 2005
I can find getColumnTemplate() and getRowTemplate(). But I cannot find getCellTemplate(). How can I use it?
Satoshi
Thursday, December 8, 2005
Satoshi,
The message right above yours shows you the 3 ways that you can use it. What more are you looking for?
Jim Hunter
Thursday, December 8, 2005
Jim,

I have same question as Satoshi. When I use getCellTemplate it gives me an error "getCellTemplate is not a function"

I am using 1.0 version. Can you tell me what should I use to change color of single cell in version 1.0

Sonika
Wednesday, January 25, 2006
I have the same problem. The only available download is version 1.0.2. How can I get version 2???
Fifty2weekhi
Wednesday, February 1, 2006
There is a link on the Home Page for version 2.0 Beta. it is the very first item in the list.

I do not know how to change the color of a single cell in 1.0 and I have moved all my work over to 2.0, sorry that I can't answer the question for you all.
Jim Hunter
Wednesday, February 1, 2006
You change color as follows

function myColor(){
var value = this.getItemProperty("value");
return value > 10000 ? "red" : "blue";
}

obj.getColumnTemplate(0).setStyle("color", myColor);

The only problem is it will go through all the rows. Even if you want only the first row.

SG
Thursday, February 2, 2006
text color change on mouseover
Kiran
Friday, February 10, 2006



This topic is archived.

Back to /active.howto.style.grid/colors-fonts-etc.html

Documentation:

Forum search