问题
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.
- 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.
- 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 tell me what is the problem in my code:
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>'
}]
}
});
回答1:
only create Ext.Panel({}) and into these Panel can you put others Sencha elements. I hope help you. :)
回答2:
The reason is navigationview
and panel
are set this config: layout: 'card'
by default.
To have all your components display on single page, extend Ext.Container
and add layout: 'vbox'
to its config.
Hope it helps.
来源:https://stackoverflow.com/questions/10611855/how-to-display-list-and-other-labels-in-single-page-using-sencha-touch2