:: Forum >>

cell format

I copied the following code into my program and it prevents my the loading of the grid and data. If I comment it out, the grid works fine.
Any ideas why this might happen.
var string = new AW.Formats.String;
var number = new AW.Formats.Number;
number.setTextFormat("$ #,###.##");
var date = new AW.Formats.Date;
date.setDataFormat("ISO8601");
date.setTextFormat("mm/dd/yy");
grid.setCellFormat([string, number, number, date]);

Here is my grid:
var grid = new AW.UI.Grid;
grid.setSize(725, 300);
grid.setPosition(20, 100);
grid.setHeaderText(myColumns);
//grid.setCellText(myData);
grid.setColumnCount(4);
grid.setSelectionMode("single-row");
grid.setSelectedRows([1]);
grid.getRowTemplate().setClass("text", "wrap");
grid.setCellTemplate(new AW.Templates.ImageText);
//****Here is where the problem is
//var str = new AW.Formats.String;
//var num = new AW.Formats.Number;
//var date = new AW.Formats.date;
//date.setDataFormat("ISO8601");
//date.setTextFormat("mm/dd/yy");
//grid.setCellFormat([date,str,str,str);
//****end of problem
grid.setCellModel(table);
grid.setColumnIndices([0,1,2,3]);
grid.setSelectorVisible(true);
grid.setSelectorWidth(28);
grid.setSelectorText(function(i){return this.getRowPosition(i)});
grid.setRowCount(5);
grid.setCellEditable(false);

Saturday, August 5, 2006
I guess the problem might be in this line -

//grid.setCellFormat([date,str,str,str);

- missing closing braket
Alex (ActiveWidgets)
Tuesday, August 8, 2006
But why do you want to apply multiple formats to one cell
Raj
Wednesday, March 7, 2007
The code applies date format to the first column, string format to the second column, string format to the third column and string format to the fourth column.

Documentation is at http://www.activewidgets.com/aw.ui.grid/cell-format.html

Ankur
Ankur Motreja
Wednesday, March 7, 2007

This topic is archived.


Back to support forum

Forum search