sencha touch How to make navigation like Touch-Theming example by sencha touch

夙愿已清 提交于 2019-12-12 02:54:07

问题


I am creating an app in which I have to create the popup like sencha touch theming expample to select the navigation items.

I tried to see its code on github for a hint but don't know what I am missing hare is my code for header bar and the list button.

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'
        }
    ]
}
});

`

and code for my controller main.js to Handel the tab action on list button.

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)
},
});

`

when I try to click on the list button on the top the error i see in my console is this

Uncaught TypeError: Object [object Object] has no method 'getStyleBubble'

and also I didn't see any definition for this 'getStyleBubble' function in any of the file in model, views, controller, store directories. So is it defined in any touch directories files or I am missing something.


回答1:


There is no getStyleBubble() function deceleration in the controllers file also not in any file if you download the whole source code zip folder I think they have not uploaded complete source code. But i found solution to my answer. I have to create a new panel and make it toggle with the click of the list button like this.

 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);

`



来源:https://stackoverflow.com/questions/16353827/sencha-touch-how-to-make-navigation-like-touch-theming-example-by-sencha-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!