Sets or retrieves the data in the top-left corner of the grid control (top selector data). Converted to the display text by the top format object.
var value = obj.getTopData();
obj.setTopData(value);
obj.onTopDataChanging = function(value){...};
obj.onTopDataChanged = function(value){...};
obj.onTopDataError = function(value){...};
Encoding html control characters (<
, >
, "
, &
).
obj.setTopData("<top text>");
obj.setTopFormat(new AW.Formats.String);
obj.setTopText(function(i){
var data = this.getTopData(i);
var format = this.getTopFormat(i);
return format ? format.dataToText(data) : data;
});
Applying number format
var number = new AW.Formats.Number;
number.setTextFormat("$ #,###.##");
obj.setTopData("1234567.890");
obj.setTopFormat(number);
obj.setTopText(function(i){
var data = this.getTopData(i);
var format = this.getTopFormat(i);
return format ? format.dataToText(data) : data;
});
Should always be used together with the top format object and converter function in the top text property (see the examples above).
Overview: using format converters
Grid templates: top selector
Top model: text, image, tooltip, link, value, format
Data properties: cell, selector, header, footer, bottom