0

Below is the code I am using to create a modal -

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

In this modal, there are thumbnail images. Clicking on any from these image will set the tapped imaeg as carousel's active item and the modal will be closed/hidden. But I am unable to close/hide the modal. How can I do this? Thanks in advance.

4

1 回答 1

2

基本上得到了参考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
于 2013-10-01T10:20:37.100 回答