||View All MessagesBack to WebFX|
I have tables where numeric data is aligned to right and formatted using spaces like
I tried DOM DHTML grid from
This sorts such column data properly without requiring specifying a sort type.Your code does not sort this properly: it ignores leading spaces.
I generate tables dynamically. All table layouts are described in a database. Using your code requires an extra step to generate also sort array. This is a minor problem. If such change is not planned, I can change my code to generate sort types array.
Could you explain why you are not using a number sort?
The DOM model in IE does not include white spaces and the sortable table uses the DOM as the data source.
My numbers are always left-aligned so that character sorting can select them properly.
The problem is that character sorting ignores leading spaces.
Why sortable table ignores leading spaces ? I think this is a bug !
It it possible to change the scipt so that character sorting does not ignore
leading spaces like sorting in the the dhtml grid from dhtmlgrid.sourceforge.net
From: Erik Arvidsson
Sent: June 12, 2003
Subject: Re:SorTable - bugs with minus (-) values...
Did you set the sort type to Number for that column? The behavior you are describing seems to be the case sensitive string search.
Hi, Love the sortable script but in my project I am working with many minus values aswell as plus values.
Whats happening though, is I have values like -3.63, -1.34, -12.45, 20.45 etc.
Now, if I have a column in which ALL numbers have 2 digits infront of the decimal place (not two decimal places) eg 12.45 and the numbers are mixed plus and minus values, it works fine.
However, if just one of the numbers in that column has 1 digit infront of the decimal eg 3.56 when the rest have two, it chokes and doesn't sort properly.
The same happens if ALL numbers are one digit infront of the decimal and one or two numbers have two.
Does anyone have any idea why this is happening and if so can it be fixed?
Much appreciate any help,