PDA

View Full Version : GridPanel Order problem



luca.santaniello
18 Apr 2011, 1:58 AM
Hi all,

I have a Ext.grid.GridPanel that contains many columns. 1 column is Double. When I order this colums, order is wrong. Ext order my grid usng string ording. I want number order...

When I set JsonStore I set type data as Double:
...{name: 'myField', type: 'double'}...

When I set ColumnModel I don't define type. Is it correct?
{header: 'My Double data', sortable: true, dataIndex: 'myField'}

For example:

Wrong Ext order:
0,8
11,55
12,61
5,68
8,7

Order right:
0,8
5,68
8,7
11,55
12,61

Thanks in advance

LS

mitchellsimoens
18 Apr 2011, 6:08 AM
All you have to do on your Column is set sortable.

Also, what is the type 'double'? Have you tried number, float or even int?

luca.santaniello
18 Apr 2011, 7:13 AM
All you have to do on your Column is set sortable.

Also, what is the type 'double'? Have you tried number, float or even int?

Yey, it is sortable. I found my bug! Asyncron request return string field, with comma and not dot. This is my problem! Ext don't convert string to number and use string order!

My solution is read all items returned and create n Record object. In number field I replace comma with dot and It run.

Can you give me other solution?

Thanks