:: Documentation >>

header data

Sets or retrieves the data in the grid column headers (header data). Converted to the display text by the header format object.

Syntax

var value = obj.getHeaderData(); 
obj.setHeaderData(value);        

obj.onHeaderDataChanging = function(value){...}; 
obj.onHeaderDataChanged = function(value){...}; 
obj.onHeaderDataError = function(value){...}; 

Defined in

header model

Examples

Encoding html control characters (<, >, ", &).

obj.setHeaderData("<header text>", 0);
obj.setHeaderFormat(new AW.Formats.String, 0);
obj.setHeaderText(function(i){
    var data = this.getHeaderData(i);
    var format = this.getHeaderFormat(i);
    return format ? format.dataToText(data) : data;
});

Applying number format

var number = new AW.Formats.Number;
number.setTextFormat("$ #,###.##");

obj.setHeaderData("1234567.890", 0);
obj.setHeaderFormat(number, 0);
obj.setHeaderText(function(i){
    var data = this.getHeaderData(i);
    var format = this.getHeaderFormat(i);
    return format ? format.dataToText(data) : data;
});

Remarks

Should always be used together with the header format object and converter function in the header text property (see the examples above).

See also

Overview: using format converters
Grid templates: header
Header model: text, image, tooltip, link, value, format
Data properties: cell, selector, footer, top, bottom

Comments

ColumnHeader with double line text Jonas Boering (4)

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