【问题标题】:Can't Hide Modal from Inside无法从内部隐藏模态
【发布时间】:2013-10-01 18:20:37
【问题描述】:

下面是我用来创建模态的代码 -

    var thumbImage = new Array();
    var me = this;

    for (var i = 0; i < thumbnail.length; i++) {

        thumbImage[i] = {
            xtype: 'panel',
            html: '<img class="thumbView" src="' + thumbnail[i].thumb + '"/>',
            thumbIndex: i,
            listeners: {
                initialize: function(thisID) {

                    this.element.on('tap', function(e, t) {
                        me.setActiveCarouselItem(thisID.thumbIndex);
                    });
                }
            }
        };
    }

    Ext.Viewport.add({
        xtype: 'panel',
        itemId: 'thumbmodal',
        centered: true,
        cls: 'thumb-panel',
        float: true,
        modal: true,
        hideOnMaskTap: true,
        scrollable: true,
        items: thumbImage
    });

在此模式中,有缩略图。单击这些图像中的任何一个都会将点击的图像设置为轮播的活动项目,并且模式将被关闭/隐藏。但我无法关闭/隐藏模式。我怎样才能做到这一点?提前致谢。

【问题讨论】:

    标签: javascript extjs4 sencha-touch-2


    【解决方案1】:

    基本得到thumbmodal的引用,调用hide方法。

    // same code
    
        initialize: function(thisID) {
    
            this.element.on('tap', function(e, t) {
               me.setActiveCarouselItem(thisID.thumbIndex);
               Ext.Viewport.down('#thumbmodal').hide();
            });
        }
    
    // same code
    

    【讨论】:

    • @Viswa--- 非常感谢!!!!!!我正在尝试没有# 符号的解决方案,但它没有发生............非常感谢!!!
    猜你喜欢
    • 1970-01-01
    • 2019-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多