简体   繁体   English

ExtJS - 活动选项卡失去了隐藏子面板的焦点

[英]ExtJS - Active tab loses focus on hiding a child panel

Ext.Panel contains two child panels which are toggled with a switch button using hide() and show(). Ext.Panel 包含两个子面板,它们通过使用 hide() 和 show() 的切换按钮进行切换。
A parent panel contains the Ext.Panel and is set active based on the customer for which it is called.父面板包含 Ext.Panel 并根据调用它的客户设置为活动状态。 On calling hide() for the child panel the active tab loses focus and scrolls to the right.在为子面板调用 hide() 时,活动选项卡失去焦点并向右滚动。 It should be like image below它应该像下面的图片
在此处输入图像描述
Displays like below显示如下
在此处输入图像描述

Using Below code to hide and show使用下面的代码隐藏和显示

tab.getActiveTab().query("panel[detailsViewPanel]")[0].hide()  
tab.getActiveTab().query("panel[compactViewPanel]")[0].show()

Panel Definition面板定义

detailsPanel = new Ext.Panel(
         {
            id : Id,
            title : tabName,
            iconCls : 'tabs',
            tabTip : tabName,
            autoHeight : true,
            closable : true,
            recordData:data,
            items :[detailsViewPanel,compactViewPanel]
        });

A fiddle may help understand the issue better.小提琴可能有助于更好地理解这个问题。 You can have card layouts within tabs and other card layouts.您可以在选项卡和其他卡片布局中拥有卡片布局。 This may work better than doing a hide and a show.这可能比隐藏和表演更好。

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

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