// create data formats
var string = new Active.Formats.String;
var number = new Active.Formats.Number;
var date = new Active.Formats.Date;
// define formatting rule for text output
number.setTextFormat("");
date.setTextFormat("dd mmm yy");
date.setDataFormat("auto");
var table = new Active.Text.Table;
table.setProperty("URL", "/dev-bin/getGridText.pl?gridtype=1");
// set column formatting
formats = [number, string, string, string, string, date, date];
var obj = new Active.Controls.Grid;
obj.setDataText(function(i, j){return formats[j].dataToText(myData[i][j]
)});
obj.setDataValue(function(i, j){return formats[j].dataToValue(myData[i][
j])});
obj.setColumnValues([0,1,2,5]);
obj.setProperty("column/count", 5);
obj.setModel("data", table);
table.request();
document.write(obj);
var date = new Active.Formats.Date;
date.setTextFormat("dd mmm yy");
date.dataToValue = function(v){return v}
var table = new Active.Text.Table;
var formats = [string, string, date, string, string];
var _getText = table.getText;
table.getText = function(i, j){
return formats[j].dataToText(_getText.call(this, i, j));
}
This topic is archived.