PDA

View Full Version : ST2PR2: xtype: list with explicit data is not rendering anything



stefankendall
27 Jan 2012, 8:24 PM
I'm trying to render a simple static list in ST2PR2, but I can't seem to nail this down. Is there any reason why this example should be rendering nothing? If I use {html:'hello'} instead of the list, I see 'hello' in the panel, so I'm not sure any of the setup is wrong.

The elements specified by the fixed data store are not added to the DOM (or rendered, obviously). Why?


Ext.define('MoreList', {
extend:'Ext.data.Model',
fields:[
{name:'text', type:'string'}
]
});
var listStore = Ext.create('Ext.data.Store', {model:'MoreList', data:[{text:'hello'}]});


wendler.views.MoreInfoList = {
id:'more-info-list-panel',
xtype:'panel',
items:[
{
xtype:'toolbar',
title:'More',
docked:'top'
},
{
id:'more-info-list',
xtype:'list',
useComponents: true,
itemConfig: {
cls: 'more-info-row'
},
itemTpl:'{text}',
store:listStore
}
]
};

rdougan
27 Jan 2012, 9:39 PM
Remove the useComponents and itemConfig configurations form your list. You do not need them.

There is also a very simple example of the List component in the documentation: http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.List

edspencer
27 Jan 2012, 11:20 PM
Also be sure to upgrade to PR4, PR2 is rather old...

stefankendall
28 Jan 2012, 11:41 AM
I need Sencha IO support, and PR4 has localstorage issues that are supposedly fixed in the beta that broke in PR3. Removing the two config options did nothing; I'll check the example.

stefankendall
28 Jan 2012, 12:23 PM
I found the issue.

I hadn't specified "layout" on the xpanel! Shouldn't this be an error?

Regardless, this is resolved!

gypsie
13 Feb 2012, 3:15 AM
I hadn't specified "layout" on the xpanel!


that solved it for me too. thanks

littlepine
22 Apr 2012, 9:18 PM
that solved it for me too. thanks
O Yeah!! It also solved my issue which I faced for 2 days!!
Thank you very much !

Zarathon
5 Oct 2012, 6:34 PM
Resolved to me too!