PDA

View Full Version : Strange sorting behavior for a simple ArrayStore



js_coder
1 Mar 2010, 11:07 AM
I have a store that sorts in an unexpected way. Here is the store code:

store: {
xtype: 'arraystore',
fields: ['field', 'value']
}And here's how it sorts. Note that the first two records change places, nothing more. That is the unexpected behavior.

Sorted descending:

[
["Docid", "LST-001-00000003"],
["Client Id", "3"],
["Comments", null],
["Conversation", null],
["Conversation Topic", null],
["Beg Attach", null],
["Beg Doc", "LS001-0000064"],
["Box", null],
["Categories", null],
["Category", "Non-Responsive"]
]And sorted ascending:

[
["Client Id", "3"],
["Docid", "LST-001-00000003"],
["Comments", null],
["Conversation", null],
["Conversation Topic", null],
["Beg Attach", null],
["Beg Doc", "LS001-0000064"],
["Box", null],
["Categories", null],
["Category", "Non-Responsive"]
]I don't think this is relevant, but here is the column that is sorting:

{
header: t('value'),
dataIndex: 'value',
sortable: true
}
The column that precedes it sorts on the field "field," and does so accurately.

js_coder
1 Mar 2010, 11:16 AM
Solved, I had to set a type for the field in question.