I've got a bunch of records whose names are like "Itemtype #", and when they are outputted into a tree view, they're sorted incorrectly, like so:
- Item 1
- Item 10
- Item 11
- Item 12
- Item 13
- Item 2
- Item 3
- Item 4
My model fields are defined as follows, and I am sorting on "Name":
fields: [
{ name: 'Id', defaultValue: 0, type: 'int', mapping: 'Id' },
{ name: 'Name', defaultValue: '', type: 'string', mapping: 'Name', sortType: Ext.data.SortTypes.asUCString },
{ name: 'Type', defaultValue: 0, type: 'int', mapping: 'Type' },
{ name: 'CreationDate', type: 'date', mapping: 'CreationDate' }
],
Can anybody point me in the right direction? I'm using extjs 4.0.5
Best Answer
In store you have to set up how the data will display by sorters property: