简体   繁体   English

如何在extjs中多次隐藏和显示面板

[英]How to hide and show panel multiple times in extjs

I am trying to catch all updates in grid and want to show message with html config in panel docked at bottom in grid. 我试图捕获网格中的所有更新,并希望在停靠在网格底部的面板中使用html config显示消息。 If I click on one button show preview then this message panel will be hide. 如果单击一个按钮显示预览,则该消息面板将被隐藏。

This is working fine but when I click on show preview button multiple times. 这工作正常,但是当我多次单击“显示预览”按钮时。 and edit some field from grid then dom of message panel is getting as null. 并从网格中编辑一些字段,然后消息面板的dom为null。 throwing an error TypeError: Argument 1 of Node.insertBefore is not an object. 引发错误TypeError: Argument 1 of Node.insertBefore is not an object. I am using extjs 6 version. 我正在使用extjs 6版本。

EDIT : Hi. 编辑:嗨。 Here is my code to hide/show panel and changing message from panel as per condition. 这是我的代码,用于根据条件隐藏/显示面板以及从面板更改消息。

var notePanel = Ext.getCmp("notePanelContainer");

if(ispropertyupdate) {
    notePanel.update("Property panel has been updated."); 
} else {
    notePanel.update("Fields grid has been updated."); 
}
if(ishide){
    notePanel.hide();
}else{
    notePanel.show();
}

Not sure what you exactly doing, but I created this simple fiddle to illustrate solution for your task (at least as I understand it). 不知道您到底在做什么,但是我创建了这个简单的小提琴来说明您任务的解决方案(至少据我了解)。

As I understand you use Ext.panel.Panel as docked item to show your message, its too heavy component for this task. 据我了解,您将Ext.panel.Panel用作停靠项来显示您的消息,这对于该任务来说太重了。 Use something like Ext.Component . 使用类似Ext.Component的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM