3.2.0

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);

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

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

- missing closing braket
Alex (ActiveWidgets)
August 8,
But why do you want to apply multiple formats to one cell
Raj
March 7,
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
March 7,

This topic is archived.

See also:


Back to support forum