Commit 0eacf9b3 authored by Frank Bergmann's avatar Frank Bergmann

- Sencha TS

parent 6ed19bc9
......@@ -67,14 +67,13 @@ Ext.application({
xtype: 'list',
title: 'List',
iconCls: 'star',
itemTpl: '<div class="contact2"><strong>{firstName}</strong> {lastName}</div>',
itemTpl: '<div class="contact2"><strong>{first_names}</strong> {last_name}</div>',
disclosure: true,
grouped: true,
indexBar: true,
onItemDisclosure: function(record, item, index, e) {
//show a messagebox alert which shows the persons firstName
e.stopEvent();
Ext.Msg.alert('Disclose', 'Disclose more info for ' + record.get('firstName'));
this.getDetailCard().setHtml(post.get('content'));
},
store: 'Contacts'
......
Ext.define('PO.store.Contacts', {
extend: 'Ext.data.Store',
config: {
fields: ['firstName', 'lastName'],
sorters: 'firstName',
fields: ['first_names', 'last_name'],
autoLoad: true,
sorters: 'first_names',
grouper: {
groupFn: function(record) { return record.get('firstName')[0]; }
groupFn: function(record) {
var fn = record.get('first_names');
if (fn == null) { return 'a'; }
return fn[0];
}
},
proxy: {
type: 'rest',
url: '/intranet-rest/user',
appendId: true,
extraParams: {
format: 'json'
},
reader: {
type: 'json',
rootProperty: 'data'
}
}
/*
data: [
{ firstName: 'Ed', lastName: 'Spencer' },
{ firstName: 'Tommy', lastName: 'Maintz' },
{ firstName: 'Aaron', lastName: 'Conran' },
{ firstName: 'Jamie', lastName: 'Avins' }
{ first_names: 'Ed', last_name: 'Spencer' },
{ first_names: 'Tommy', last_name: 'Maintz' },
{ first_names: 'Aaron', last_name: 'Conran' },
{ first_names: 'Jamie', last_name: '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