3.2.0

Using AW.Formats.Number

Hi,
I have a AW column containing values 1/1, 1/2,...1/10, 2/1,2/2,...2/20 etc.
I tried using:
var obj = new AW.Formats.Number;
obj.setTextFormat("##/##");
obj.dataToValue1 = obj.dataToValue;
obj.dataToValue = function(data){
return data ? this.dataToValue1(data) : "";
}

But it displays "1/1, 1/2,....2/1, 2/2,....1/10, 2/20";
But I expected after 1/9, 1/10 would come, but after 1/9, 2/1 came.

Is there a solution with AW for handing this sorting
I really appreciate your help.
Thanks,
VJ
January 9,
You need to write your own textToValue or dataToValue method depending on whether you use setCellText() or setCellData() methods to assign the data to the grid.
Alex (ActiveWidgets)
January 13,
Thanks Alex for your reply.
I was also thinking on the same lines, but was not sure.
As the actual AW functions datatoValue, I think converts 1/2 to 12, and 1/10 to 110, and then displays, so sorting was not done as I expected. I would be writing a new function to sort the values as per my requirement.
VJ
January 13,

This topic is archived.

See also:


Back to support forum