【发布时间】:2012-05-13 05:28:19
【问题描述】:
我是 Sencha Touch 2 的新手,我想拥有类似的东西:
- 一个列表(例如用于待办事项,仅用于试用 ST2),我可以在其中点击以进行编辑或将其设置为已完成等。
我不确定我做得对,但我想我有一个面板,其中左侧包含列表,右侧包含详细信息视图。查看 Conatiner 的文档:
//this is the Panel we'll be adding below
var aboutPanel = Ext.create('Ext.Panel', {
html: 'About this app'
});
//this is the Panel we'll be adding to
var mainPanel = Ext.create('Ext.Panel', {
fullscreen: true,
layout: 'hbox',
defaults: {
flex: 1
},
items: {
html: 'First Panel',
style: 'background-color: #5E99CC;'
}
});
//now we add the first panel inside the second
mainPanel.add(aboutPanel);
我想我也许可以使用config 属性来配置我的面板:
Ext.define("SimpleTodo.view.Main", {
extend: 'Ext.Panel',
config: {
items: [
{
xtype: 'panel',
config: {
html: 'Panel 1 ...'
}
},
{
xtype: 'panel',
config: {
html: 'Panel 2 ...'
}
}
]
}
});
失败:空白屏幕。如果我将html 属性添加到config 中,我会显示HTML,但是我在items 上做错了什么?
您可能还注意到,我有一个左侧列表和右侧详细信息列表。这对平板电脑很好,但我怎样才能让它适用于手机呢?我是否需要为它们使用配置文件和单独的视图?
【问题讨论】:
标签: html sencha-touch extjs sencha-touch-2