Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ExtJs选项卡下的Custome MessageBox_Extjs_Extjs4_Messagebox - Fatal编程技术网

ExtJs选项卡下的Custome MessageBox

ExtJs选项卡下的Custome MessageBox,extjs,extjs4,messagebox,Extjs,Extjs4,Messagebox,我喜欢将MessageBox选项卡分开。一个消息框将显示在一个特定的选项卡中,并对所有其他选项卡隐藏。现在在应用程序中显示为全局的内容。是否有任何方法可以在应用程序中的每个选项卡下显示消息。当messagebox是一个单独的选项卡时,您不能同时在单独的选项卡上使用具有不同内容的messagebox,但您可以创建自己的messagebox,从窗口扩展并将每个实例呈现到单独的选项卡。这里是本机窗口,但它对扩展组件的作用相同 您不能直接使用Ext.window.MessageBox实现您想要的功能。另

我喜欢将MessageBox选项卡分开。一个消息框将显示在一个特定的选项卡中,并对所有其他选项卡隐藏。现在在应用程序中显示为全局的内容。是否有任何方法可以在应用程序中的每个选项卡下显示消息。

当messagebox是一个单独的选项卡时,您不能同时在单独的选项卡上使用具有不同内容的messagebox,但您可以创建自己的messagebox,从窗口扩展并将每个实例呈现到单独的选项卡。这里是本机窗口,但它对扩展组件的作用相同

您不能直接使用Ext.window.MessageBox实现您想要的功能。另一方面,您可以创建一个扩展Ext.window.window的小实用程序类,使用静态函数使其以标题、消息和按钮作为参数显示,并使用constrainTo选项使其属于您的选项卡


这样,您就有了一个可由选项卡拥有的窗口,而不是全局显示的窗口。在这里,我创建了一个函数,将消息显示为messagebox。我可以用任何我需要的东西

ShowPrivateMessage: function(title, widthValue, heightValue, msgText, renderTabId){
    Ext.create("Ext.window.Window",{
        title : title,
        width : widthValue,
        height: heightValue,
        html : '<span style="font-size: small">'+ msgText + '</span>',
        renderTo: renderTabId,
        resizable: false,
        draggable: false,

        bodyPadding: '10px',
        listeners:{
            afterrender: function(sender, eOpt){
                var parentWindow = Ext.getCmp(renderTabId);
                parentWindow.disable();
            }
            ,close: {
                fn:function(ctrl,opt){
                    var parentWindow = Ext.getCmp(renderTabId);
                    parentWindow.enable();
                }
            }
        }
    }).show();
}

请提供可以涵盖您的示例的代码