Generic base class for the various data format converters.
Format converters are used to change the data appearance between 'datasource' format and the actual display text, for example, when the source XML contains dates in ISO8601 format (like 2004-05-18T00:00:00+01:00
) but the end users want to see them as mmm d, yyyy
(May 5, 2004
).
They are also used for sorting of the grid rows the format objects convert the cell text to the comparable values and supply comparator function.
var obj = new AW.System.Format;
Parent Classes:
AW.System.Object |
clone | Creates an object clone. |
comparator | Returns comparator function. |
dataToText | Transforms the external data to the readable text. |
dataToValue | Transforms the external data to the native value type. |
init | Initializes the object. |
setErrorText | Sets the error text. |
setErrorValue | Sets the error value. |
setTimeout | Calls the function after the specified delay. |
textToData | Transforms the text to the external data format. |
textToValue | Transforms the text to the native value type. |
toString | Converts object to string. |
valueToData | Transforms the value to the external data format. |
valueToText | Transforms the value to the readable text. |
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("mm/dd/yy");
grid.setCellFormat([string, number, number, date]);
Overview: formats/conversions
Formatting classes: number, string, html, date,
Grid cell properties: text, value, data, format