PDA

View Full Version : how to display list and other labels in single page



Rameshlamani
15 May 2012, 4:49 AM
Hi, i am new to sencha touch2. i want to display some text labels below in that want display list. so i have define some labels and accessing twitter service it will give list of data. below is my code.

1)in this code if i comment the extend: 'Ext.form.Panel', if i used extend: 'Ext.navigation.View' then list data will display but wont display defined labels.
2) if i comment the extend: 'Ext.navigation.View', if i used extend: 'Ext.form.Panel' then list data wont display but it will display defined labels.
please tel me what is the pbm in my code:

here is code:

Ext.define("E:\SenchaTouch.view.Main", {
extend: 'Ext.form.Panel',
//extend: 'Ext.navigation.View',
xtype: 'companyprofilepage',
id: 'companyprofile',
config: {
items: [
{
xtype: 'toolbar',
docked: 'top',
title: 'My Toolbar'
},
{
xtype: 'titlebar',
title: 'Title name'
},
{
margin: '10',
xtype: 'label',
html: 'Info1'
},
{ margin: '10',
xtype: 'label',
html: 'A company is a business organization. It is an association or collection of individual real '
},
{
xtype: 'list',
itemTpl: '{title}',
store: {
autoLoad: true,
fields: ['from_user', 'text', 'profile_image_url'],
proxy: {
type: 'jsonp',
url: 'http://search.twitter.com/search.json?q=Sencha Touch',
reader: {
type: 'json',
root: 'results'
}
}
},
itemTpl: '<img src="{profile_image_url}" /><h2>{from_user}</h2><p>{text}</p>'
},
]
}
});

mitchellsimoens
17 May 2012, 5:30 AM
The list doesn't know what height to show.

mitchellsimoens
17 May 2012, 5:30 AM
E:\SenchaTouch.view.Main is not a good class name.