Align Text In An Individual Cell
I am passing an array of values (generated from php) into a one-column grid. Depending on the value, I would like to have the text in the cell either center- or left-aligned.
Here is the code I wrote to do this:
function cell_align()
{
var value = this.getItemProperty("value");
if (value == "TestValue")
{ return "center";}
return "left";
}
var row = new Active.Templates.Row;
row.setStyle("text-align", cell_align);
At the moment all of the cells are left-aligned. I know that the value is correct and true for the test.
Please let me know if this is doable.
Thanks.
Here is the code I wrote to do this:
function cell_align()
{
var value = this.getItemProperty("value");
if (value == "TestValue")
{ return "center";}
return "left";
}
var row = new Active.Templates.Row;
row.setStyle("text-align", cell_align);
At the moment all of the cells are left-aligned. I know that the value is correct and true for the test.
Please let me know if this is doable.
Thanks.
JeffE
December 9,