我使用phonegap和sencha touch来构建android应用程序。我包含了sencha-touch-all.js和sencha-touch-.css文件。
我正在使用Ext.Carousel,它工作得很好。我想使用面板作为旋转木马.If的覆盖,我写new Ext.Panel,它工作。ButExt.panel.Panel不工作它说"TypeError:Ext.panel is undefined“有帮助吗??我的代码如下:
var overlay = new Ext.panel.Panel({
overlay: true,
id:'myPanel',
width: 400,
height: 280,
left: 200,
top : 18,
style:'background-color:#00CC33' ,
cls:'my-panel',
fullscreen:true,
draggable : true,
resizable : true,
closable : true,
items: [
{
label: 'Name',
xtype: 'textfield',
name:'textField1'
},
{
label: 'Email',
xtype: 'emailfield',
name:'textField2'
},
{
label: 'Password',
xtype: 'passwordfield',
name:'textField3'
}
]
});
myCarousel.add(overlay);如果我使用Ext.Panel而不是Ext.panel.panel,它可以工作。但是我不能关闭那个面板,它没有任何关闭按钮。但我希望我的面板是可拖动的,可调整大小的和可关闭的。是否有必要将ext.js与sencha-touch-all.js一起使用?
有什么帮助吗?
发布于 2013-05-29 13:50:28
我通过这个链接找到了答案:How to embed a custom close button in top right hand corner of a Ext.MessageBox Sencha Touch 2.0
在这里写:
var box = Ext.create('Ext.Panel',
{
id: 'message-box',
title: 'title',
message: 'message',
items: [
{
xtype: 'toolbar',
height: '40px',
docked: 'top',
items: [
{xtype: 'spacer'},
{xtype: 'button',
text: 'X',
ui: 'plain',
style: {padding: '5px'},
handler: function(){Ext.getCmp('message-box').hide();}
},
],
}
]
});
box.show();https://stackoverflow.com/questions/16805693
复制相似问题