3.0 beta 2

setting a color for a single cell

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

Will appreciate any help
Adi Katz
August 23,
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
November 10,
I can find getColumnTemplate() and getRowTemplate(). But I cannot find getCellTemplate(). How can I use it?
Satoshi
December 8,
Satoshi,
The message right above yours shows you the 3 ways that you can use it. What more are you looking for?
Jim Hunter
December 8,
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
January 25,
I have the same problem. The only available download is version 1.0.2. How can I get version 2???
Fifty2weekhi
February 1,
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
February 1,
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
February 2,
text color change on mouseover
Kiran
February 10,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.