反正,我想做一個簡單的分組tableview,它不在Sencha中工作。它將所有項目一起顯示,無需添加分組。Sencha Touch不分組TableView
下面是完整的代碼:
Ext.define('MyApp.view.CompletedList', {
extend: 'Ext.dataview.List',
alias: 'widget.CompletedList',
fullscreen:true,
grouped:true,
ui:'round',
requires: [
'Ext.dataview.List'
],
config:{
fullscreen:true,
grouped:true,
store: {
fields: ['name', 'league', 'division'],
sorters: 'name',
grouper: {
groupFn: function (item) {
return item.get('league') + ' ' + item.get('division');
}
},
data: [
{
name: 'Texas',
league: 'AL',
division: 'West'
},
{
name: 'Boston',
league: 'AL',
division: 'East'
},
{
name: 'California',
league: 'AL',
division: 'West'
},
{
name: 'Costa Rica',
league: 'AL',
division: 'East'
},
{
name: 'Seattle',
league: 'AL',
division: 'East'
}]
},
itemTpl:'{name}'
}
});
這裏是截圖:
你的代碼適合我 – Viswa
它是否分組項目? –