dynamic formats
this is somthing i am trying to work out, wondering if i could get some help.
I get 2 arrays from a server myMasks which has things like "mm-dd-yy, ###,###.##, mm-dd-yy hh:mm:ssam/pm etc.." and myFormats which tells if it should be a number or date format. the goal is to format my grid whitout haveing a big list of if statments. do you see anything wrong with the code here.
it is going through fine formatting numbers and dates but ignoring how they should be formatted, for example (mm-dd-yy, is being formatted as mm-dd-yy hh:mm:ssam/pm)
I get 2 arrays from a server myMasks which has things like "mm-dd-yy, ###,###.##, mm-dd-yy hh:mm:ssam/pm etc.." and myFormats which tells if it should be a number or date format. the goal is to format my grid whitout haveing a big list of if statments. do you see anything wrong with the code here.
it is going through fine formatting numbers and dates but ignoring how they should be formatted, for example (mm-dd-yy, is being formatted as mm-dd-yy hh:mm:ssam/pm)
for(msk = 0; msk < myMask.length;msk++) //format(what format you want, what column you want
{
if(myFormat[msk] == "Number")
var format = new AW.Formats.Number;
if(myFormat[msk] == "Date")
var format = new AW.Formats.Date;
if(format != "")
{
format.setTextFormat(myMask[msk]);
format.setErrorText("");
format.setErrorValue(0);
table.setCellFormat(format, msk);
}
table.setColumnWidth(myLengths[msk], msk);
}
Ryan Garabedian
June 3,