-
18 Oct 2011 10:32 AM #1
Unanswered: Grouped List w/store?
Unanswered: Grouped List w/store?
The KitchenSink Grouped List works but it's not using a Store. I can't seem to get my Grouped List to work with a Store. If I remove "grouped:true", the list displays but sans grouping and index bar. I suspect that either I need to configure the store differently OR that there's a bug in the PR1 release.
Has anyone gotten a Grouped List to work WITH a Store?
Also, what are the "groupers" and "groupField" Store parameters for? I've tried with and without them and neither case works.
-
18 Oct 2011 1:36 PM #2
Could you post some code to see what you are doing now?
-
18 Oct 2011 2:01 PM #3
Here are snippets of the relevant sections:
Store:
Code:Ext.define('MyApp.store.EmployeesStore', { extend : 'Ext.data.Store', model : 'MyApp.model.Employee', requires: ['MyApp.model.Employee'], sorters: 'lastName', getGroupString: function(record) { return record.get('lastName')[0]; } });
View configuration:
andCode:{ xtype: 'panel', id: 'thepanel', layout: 'fit', items: [ { id: 'thelist', xtype: 'list', itemTpl: '<span>{firstName} <b>{lastName}</b></span>', grouped: true, indexBar: true } ] }
Code:initialize: function() { console.log('initialize:'); var theList = this.down('#thelist'); var theStore = new MyApp.store.EmployeesStore(); // add Employee objects to store theList.setStore(theStore);
-
19 Oct 2011 7:26 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
- Answers
- 28
I think there might be an issue with list.setStore atm. Are you using the new MVC architecture? If that is the case you should be able to just do:
As long as you define stores: ['EmployeesStore'] in your Application or any Controller.PHP Code:{
xtype: 'panel',
id: 'thepanel',
layout: 'fit',
items: [
{
id: 'thelist',
xtype: 'list',
itemTpl: '<span>{firstName} <b>{lastName}</b></span>',
grouped: true,
indexBar: true,
store: 'EmployeesStore'
}
]
}


Reply With Quote
