我目前有这样的分组:
代码:
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});
var store = new Ext.data.JsonStore({
model : 'Contact',
getGroupString : function(record) {
//return record.get('lastName')[0];
return record.get('group');
},
data: [
{firstName: 'Tung', lastName: 'Hauw', group: 'Parents'},
{firstName: 'Regina', lastName: 'Clarissa', group: 'Parents'},
{firstName: 'Melvin', lastName: 'Gilbert', group: 'Children'},
{firstName: 'Jeaffrey', lastName: 'Gilbert', group: 'Children'},
{firstName: 'Melissa', lastName: 'Merryl Gilbert', group: 'Children'},
{firstName: 'Jesica', lastName: 'Merryl Gilbert', group: 'Children'}
]
});
var list1 = new Ext.List({
flex: 1,
cls: 'list_simple',
sorters: ['firstName', 'group'],
itemTpl: '{firstName} {lastName}',
grouped: true,
groupTpl : [
'<tpl for=".">',
'<div class="x-list-group x-group-{id}">',
'<h3 class="x-list-header"><div class="header">{group}</div></h3>',
'<div class="x-list-group-items">',
'{items}',
'</div>',
'</div>',
'</tpl>'
],
onItemDisclosure: function(record, btn, index) {
Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('firstName') + ' ' + record.get('lastName'), Ext.emptyFn);
},
store: store
});
我需要针对特定群体进行具体披露。使用上面的代码,我得到所有组都有相同的披露。我正在尝试实现这个设计:
没有披露父母的物品。如果我们在 Parent 的行上滑动,我们将看到 Remove 按钮。此外,它有点击事件。
我不知道应该在哪里移动/更改披露事件。有人可以帮助我吗?