:: Documentation >>

dataToText

Converts the data coming from the datasource to the display text. This method is used internally by the grid control to produce the cell text from the cell data property.

null

Syntax

var text = format.dataToText(data);

Parameters

data (string) - incoming data string (from the datasource)

Returns

text string formatted for display

Examples

// create and configure date converter
var date = new AW.Formats.Date;
date.setDataFormat("ISO8601");
date.setTextFormat("mmm d, yyyy");

var data = "2004-05-18T00:00:00+01:00";
var text = date.dataToText(data); // May 18, 2004

Remarks

The dataToText() method is implemented in the base class as a sequence of dataToValue() and valueToText() calls -

obj.dataToText = function(data){
    var value = this.dataToValue(data);
    return this.valueToText(value);
};

Derived classes (AW.Formats.Number, AW.Formats.Date) overwrite dataToText() and valueToText() methods according to the pattern specified in the setTextFormat() call.

If the data cannot be parsed - the method returns error text which can be configured with setErrorText() call.

See also

AW.System.Format methods: dataToValue, valueToText, setErrorText
Formatting classes: number, string, html, date
Grid cell properties: text, value, data, format

Comments

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5