首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在sencha touch中使用Ext.panel.Panel?

如何在sencha touch中使用Ext.panel.Panel?
EN

Stack Overflow用户
提问于 2013-05-29 12:48:08
回答 1查看 1.1K关注 0票数 0

我使用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“有帮助吗??我的代码如下:

代码语言:javascript
复制
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一起使用?

有什么帮助吗?

EN

回答 1

Stack Overflow用户

发布于 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

在这里写:

代码语言:javascript
复制
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();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16805693

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档