Sets or retrieves the data format converter for the grid row selector.
Format converters are used to perform client-side data transformations, for example, encode html control characters or apply particular date or number formats.
var value = obj.getSelectorFormat();
obj.setSelectorFormat(value);
obj.onSelectorFormatChanging = function(value){...};
obj.onSelectorFormatChanged = function(value){...};
obj.onSelectorFormatError = function(value){...};
Encoding html control characters (<
, >
, "
, &
).
obj.setSelectorData("<selector text>");
obj.setSelectorFormat(new AW.Formats.String);
obj.setSelectorText(function(i){
var data = this.getSelectorData(i);
var format = this.getSelectorFormat(i);
return format ? format.dataToText(data) : data;
});
Applying number format
var number = new AW.Formats.Number;
number.setTextFormat("$ #,###.##");
obj.setSelectorData("1234567.890");
obj.setSelectorFormat(number);
obj.setSelectorText(function(i){
var data = this.getSelectorData(i);
var format = this.getSelectorFormat(i);
return format ? format.dataToText(data) : data;
});
To activate the data/text transformations set the selector text property to the converter function, like in example above.
Overview: using format converters
Grid templates: selector
Selector model: text, image, tooltip, link, value, data
Format properties: cell, header, footer, top, bottom