:: Forum >>

How retrieve the Cell Format for specified column?

I tryied but got nothing...

grid.getCellFormat(column);
grid.getCellFormat(column, row);
grid.getCellFormat(column, row, cel);
grid.getCellFormat(cel, column, row);


Anyone hav idea? tkz.
Paulo Cesar Silva Reis (PC from Brazil).
Friday, May 12, 2006
The default value for the cell format is null. So unless you set the format to something - those calls will return null. The correct syntax would be

grid.getCellFormat(column); // for the column
grid.getCellFormat(column, row); // for the specific cell

Alex (ActiveWidgets)
Friday, May 12, 2006
doenst work for me, see my example:

var extendedGrid = new AW.Grid.Extended;
extendedGrid.setCellFormat([new AW.Formats.Number, new AW.Formats.String, new AW.Formats.String, new AW.Formats.Number]);

...

document.write(extendedGrid);

var b1 = new AW.UI.Button;
b1.setControlText("getCellFormat?");
b1.setEvent("onclick", function() { alert(extendedGrid.getCellFormat(1));});
document.write(b1);


Maybe a bug when use ExtendedGrid ?
Paulo Cesar Silva Reis (PC from Brazil).
Friday, May 12, 2006
Works for me (?), if you change alert to typeof .. you should get "object" -

alert(typeof extendedGrid.getCellFormat(1));

Alex (ActiveWidgets)
Friday, May 12, 2006
wow... thats weird... i always get blank value, but typeof works, its show "object"... man, wtf? heheh. What can be? I really dunno.
Paulo Cesar Silva Reis (PC from Brazil).
Monday, May 15, 2006
alert function shows blank value because this is what default toString() method returns for all AW objects.
Alex (ActiveWidgets)
Monday, May 15, 2006
i got a solution, not good but works.

if(extendedGrid.getCellFormat(1) instanceof AW.Formats.String) {
// dosomething.
}
Paulo Cesar Silva Reis (PC from Brazil).
Monday, May 15, 2006

This topic is archived.


Back to support forum

Forum search