:: Forum >>

sorting issue on Integer values posing problems

I have a column of Integers and another column of floats on the same grid. When I sort the Float column, i.e. clicking on the header section of the column, the sort works just fine, it will sort it ascending, and vice versa. The problem is the same sort does not seem to work well on the column of Integers. It seems to sort it by considering the first digit in the integer, e.g. if my column values are
1, 45, 23, 112, 445, 54,
I expect the sort to order
1, 23, 45, 54, 112, 445 or vice versa 445, 112, 54, 45, 23, 1
but what I get is
1, 112, 23, 45, 445, 54 or vice versa 54, 445, 45, 23, 112, 1

as you can see the 112 comes before 23 or 54 before 445.
Does anyone know whether this is a bug or simply a setting of certain grid configuration parameters?
Tuesday, September 26, 2006
I answered my own question. For those who might be interested.

bascially the following configuration is needed inorder for the grid to identify your columns as numbers or string.

for example if I have the following columns

var myColumns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];

And I would like "Market Cap.", "$ Sales", "Employees" to be interpreted as numbers, then i do the following to the grid configuration.

var str = new AW.Formats.String;
var num = new AW.Formats.Number;
obj.setCellFormat([str, str, num, num, num]);
Thursday, September 28, 2006
You can also set it for only one column if that is all you need.

var num = new AW.Formats.Number;
obj.setCellFormat(num, column);
Thursday, September 28, 2006

This topic is archived.

Back to support forum

Forum search