0

ナビゲーション項目を選択するために、sencha touch theming exampleのようなポップアップを作成する必要があるアプリを作成しています。

ここに画像の説明を入力

ヒントを得るためにgithubでそのコードを見ようとしましたが、ヘッダー バーとリスト ボタンのコードが不足しているものがわからないのです。

Ext.define('ov_app.view.HeaderBar', {
xtype : 'HeaderBar',
extend:'Ext.Toolbar',

config: {
           // xtype : 'toolbar',
    ui: 'plain',        
    docked: 'top',
    cls: 'menuBar',
    border:0,
    defaults:{
        border: 0,
        },
    items: [

        {
            iconCls: 'list',
            iconMask: true,
            ui: 'plain',
            action: 'ShowMoreOption',
        },{
            xtype: 'spacer'
        },{
            xtype: 'container',
            html: '<img src="resources/images/logo.png">'
        },{
            xtype: 'spacer'
        },{
            iconCls: 'home',
            iconMask: true,
            id: 'homeBtn',
            ui: 'plain',
            action: 'push-view'
        }
    ]
}
});

`

リストボタンのタブアクションをHandelするためのコントローラーmain.jsのコード。

Ext.define('ov_app.controller.MainController', {
extend: 'Ext.app.Controller',
config:{
    control: {
        'button[action=push-view]': {
            tap: 'pushViewFunction'
       },
         'button[action=ShowMoreOption]':{
    tap: 'togglMenu'
    },
    },
},

pushViewFunction: function() {
ov_app.container.setActiveItem(0);
},
togglMenu: function(){
console.log("hello");
}
togglMenu: function(button) {
    this.getStyleBubble().showBy(button)
},
});

`

上部のリストボタンをクリックしようとすると、コンソールに表示されるエラーはこれです

キャッチされていない TypeError: オブジェクト [オブジェクト オブジェクト] にメソッド 'getStyleBubble' がありません

また、モデル、ビュー、コントローラー、ストアディレクトリのどのファイルにも、この「getStyleBubble」関数の定義がありませんでした。タッチディレクトリファイルで定義されているか、何か不足しています。

4

1 に答える 1

0

ソースコードのzipフォルダー全体をダウンロードした場合、コントローラーファイルにもgetStyleBubble()関数の減速はありません。完全なソースコードをアップロードしていないと思います。しかし、私は私の答えに対する解決策を見つけました。新しいパネルを作成し、このようにリスト ボタンをクリックして切り替える必要があります。

 togglMenu: function(button){
    if(!this.overlay) {
    this.overlay = Ext.Viewport.add({
        xtype: 'panel',
        modal: true,
        hideOnMaskTap: true,
        showAnimation: {
            type: 'popIn',
            duration: 250,
            easing: 'ease-out'
        },
        hideAnimation: {
            type: 'popOut',
            duration: 250,
            easing: 'ease-out'
        },
        height: 200,
        width: 200,
        //centered: true,
        styleHtmlContent: true,
        html: '<p>hello dummy content in the pop up box </p>',
        scrollable: true
    });
}
this.overlay.showBy(button);

`

ここに画像の説明を入力

于 2013-05-03T09:53:10.337 に答える