PDA

View Full Version : [FIXED] sorters config option for Ext.data.Store issue.



taka_2
25 Aug 2010, 7:15 PM
Ext.setup({
onReady : function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});

var groupingBase = {
fullscreen: true,
tpl: '<tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl>',
itemSelector: 'div.contact',
singleSelect: true,

store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',

data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'}
]
}),
listeners: {
itemtap: function(dataView, index, item, e) {
alert(dataView.getSelectedRecords()[0].get('firstName'));
}
}
};
new Ext.List(groupingBase);
}
});

The code displays a List that contains two items 'Tommy', 'Ed'.

When you tap 'Tommy'. Then you can see the message 'Ed'.
And when you tap 'Ed'. Then you can see the message 'Tommy'.
Probably Store and View is not Synchronized.

sorters config option for Ext.data.Store is undocumented.
but examples\list\src\index.js uses this config option.

evant
25 Aug 2010, 9:45 PM
What build are you running? I tried your test case with the latest from Git and it worked as I would expect.

taka_2
25 Aug 2010, 10:25 PM
I used Sencha Touch 0.93.