PDA

View Full Version : Grid Sorting does not properly orders the values.



Sandeep
14 Sep 2007, 2:47 AM
Hello,

I am facing a small issue while sorting the gird.
I have a column which contains some strings, few of them are just empty strings ie. "".

Example data is:
ABCD11111
CN5446991
NYKU 646300-6
NYKU 646300-4
OCLU 123123-2*OCLU 123123-2
9
A8
MANI123654

The problem is that whenever i click on header of this column the grid gets sorted but it does not sorts as expected.
It should sort in the order of A-Z but it gives me a random sort, a few "A" strings are at top, then a couple of "B","C","D" and so on strings.
and again randomly i get "A", "B"... strings at the bottom.

Can anyone suggest what might be causing this.

Thanks!
Sandeep.

fay
14 Sep 2007, 2:51 AM
Can you post your code please?

Nullity
14 Sep 2007, 5:40 AM
When you define the record, make sure to set that column to the correct 'type' (in this case, 'string'). Example:


var record = Ext.data.Record.create([
{name: 'id', mapping: 'id', type: 'int'},
{name: 'foo', mapping: 'foo', type: 'string'}
]);

Sandeep
16 Sep 2007, 10:27 PM
Can you post your code please?

Please find attached file.