Sets or retrieves the data format converter for the grid cells (cell format).
The text in the grid cell is produced by applying the cell format over the cell data property. This allows encoding the html control characters (<, >, ", &) in the text strings or converting numbers and dates into specific display formats. In cases where the client-side transformation is not required the cell format can be used to convert the cell text to the cell value for the correct sorting of the grid rows.
var value = obj.getCellFormat();
obj.setCellFormat(value);
obj.onCellFormatChanging = function(value){...};
obj.onCellFormatChanged = function(value){...};
obj.onCellFormatError = function(value){...};
Assign the content to the cell data and convert it with the cell formats
var myCells = [
["Item <1>", "1234.56", "2004-05-18"],
["Item 1 & 2", "9876543", "2006-02-08"]
]
var string = new AW.Formats.String;
var number = new AW.Formats.Number;
var date = new AW.Formats.Date;
number.setTextFormat("#,###.##");
date.setDataFormat("ISO8601");
date.setTextFormat("mmm d, yyyy");
var obj = new AW.UI.Grid;
obj.setCellData(myCells);
obj.setCellFormat([string, number, date]);
obj.setColumnCount(3);
obj.setRowCount(2);
document.write(obj);
Assign the content directly to the cell text and add the cell formats for the correct sorting.
var myCells = [
["Cell <i>text</i>", "123", "5/18/2004"],
["<a href='#'>More...</a>", "456", "1/12/2006"]
]
var html = new AW.Formats.HTML;
var number = new AW.Formats.Number;
var date = new AW.Formats.Date;
var obj = new AW.UI.Grid;
obj.setCellText(myCells);
obj.setCellFormat([html, number, date]);
obj.setColumnCount(3);
obj.setRowCount(2);
document.write(obj);
Overview: using format converters
Grid templates: cell
Cell model: text, image, tooltip, link, value, data, editable, state, selected
Format properties: selector, header, footer, top, bottom