Commit 6ed19bc9 authored by Frank Bergmann's avatar Frank Bergmann

- Sencha Timeshet:

  added a contacts store as an example
parent 44f1810c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Ext.application({ Ext.application({
name: 'PO', name: 'PO',
models: ['Note'], models: ['Note'],
stores: ['Notes'], stores: ['Notes', 'Contacts'],
requires: [ requires: [
'Ext.MessageBox', 'Ext.MessageBox',
...@@ -77,20 +77,7 @@ Ext.application({ ...@@ -77,20 +77,7 @@ Ext.application({
Ext.Msg.alert('Disclose', 'Disclose more info for ' + record.get('firstName')); Ext.Msg.alert('Disclose', 'Disclose more info for ' + record.get('firstName'));
}, },
store: Ext.create('Ext.data.Store', { store: 'Contacts'
fields: ['firstName', 'lastName'],
sorters: 'firstName',
autoLoad: true,
grouper: {
groupFn: function(record) {
return record.get('firstName')[0];
}
},
proxy: {
type: 'ajax',
url: 'contacts.json'
}
})
}, { }, {
title: 'Contact', title: 'Contact',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "List", "name": "List",
"js": [ "js": [
{ {
"path": "/senchatouch-v211/sencha-touch-all.js" "path": "/senchatouch-v211/sencha-touch-all-debug.js"
}, },
{ {
"path": "app.js", "path": "app.js",
......
Ext.define('PO.store.Contacts', {
extend: 'Ext.data.Store',
config: {
fields: ['firstName', 'lastName'],
sorters: 'firstName',
grouper: {
groupFn: function(record) { return record.get('firstName')[0]; }
},
data: [
{ firstName: 'Ed', lastName: 'Spencer' },
{ firstName: 'Tommy', lastName: 'Maintz' },
{ firstName: 'Aaron', lastName: 'Conran' },
{ firstName: 'Jamie', lastName: 'Avins' }
]
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment