Sets or retrieves the data in the grid column headers (header data). Converted to the display text by the header format object.
var value = obj.getHeaderData();
obj.setHeaderData(value);
obj.onHeaderDataChanging = function(value){...};
obj.onHeaderDataChanged = function(value){...};
obj.onHeaderDataError = function(value){...};
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;
});
Should always be used together with the header format object and converter function in the header text property (see the examples above).
Overview: using format converters
Grid templates: header
Header model: text, image, tooltip, link, value, format
Data properties: cell, selector, footer, top, bottom