将 javascript 数组传递给新的 ExtJS 弹出窗口 window

Passing javascript array to new ExtJS popup window

我一直在尝试将图像数组作为参数传递给新的 ExtJS 弹出窗口-window。我在下面 link

中找到了这个

Extjs pass in parameters to window on show

但是当我在我的应用程序中尝试这个时,它说未定义。下面是我的代码。

    this.btnControlPDF = Ext.create('Ext.button.Button', {          
    width: 40,
    height:33,
    border:0,
    disabled : false,
    style: 'margin: 13px 1px 1px 5px;',
    cls : 'icon-button-ControllListButtonPDF',                        
    enableToggle: true,
    toggleGroup: 'AccumulateToolButtons',
    handler : function(myButton) {
        this.reportWindow = Ext.create('Ext.view.ReportExportView');
        this.reportWindow.myExtraParams = { imgArray : imgArray };
        this.reportWindow.show();
        return;
    }
});

其中 Ext.view.ReportExportView 延伸 Ext.window.Window

我想要的是一种将 javascript 数组变量传递给新的 ExtJS 弹出窗口 window 并能够在 window.

中访问该变量的方法

我找到了 HTML5 localStorage.getItem()。我可以用它来存储我的阵列吗?

谢谢! 斯图

我希望您希望 myExtraParams 数据在 ReportExportView window 以及 this.reportWindow 中访问。如果是这样,请尝试此代码。

 this.reportWindow = Ext.create('Ext.view.ReportExportView', {
                       myExtraParams : { imgArray : imgArray } 
                   } });
 this.reportWindow.show();

ReportExportView 访问 myExtraParams 的方式。

Ext.define('Ext.view.ReportExportView', {
    extend: 'Ext.window.Window',
    alias: 'widget.reportwindoww',
    width: 500,
    height: 250,
    layout: 'fit',
    initComponent: function(){
       console.log(this.myExtraParams);
       //You can write the remaining code here.
       this.items = [{
            xtype: 'panel',
            ...............
            ...............
       }];
       this.callParent(arguments);  
    }
 });