什么是Magento';的UI对象层次结构


What are Shadow Tabs in Magento's UI Object Hierarchy?

我正在浏览Magento内部,在Widget/Tab渲染层次结构中,有一个阴影选项卡的概念我有点模糊。当你为表单定义选项卡时,你可以将其绑定为阴影选项卡

protected function _prepareLayout()
{
    parent::_prepareLayout();
    $this->addTab('bundle_items', array(
        'label'     => Mage::helper('bundle')->__('Bundle Items'),
        'url'   => $this->getUrl('*/*/bundles', array('_current' => true)),
        'class' => 'ajax',
    ));
    $this->bindShadowTabs('bundle_items', 'customer_options');
}

bindShadowTabs方法是具有的文档

/**
 * Mark tabs as dependent of each other
 * Arbitrary number of tabs can be specified, but at least two
 *
 * @param string $tabOneId
 * @param string $tabTwoId
 * @param string $tabNId...
 */
public function bindShadowTabs($tabOneId, $tabTwoId)

利用PHP对象的Javascript看起来像

showTabContentImmediately : function(tab) {
    this.hideAllTabsContent();
    var tabContentElement = $(this.getTabContentElementId(tab));
    if (tabContentElement) {
        Element.show(tabContentElement);
        Element.addClassName(tab, 'active');
        // load shadow tabs, if any
        if (tab.shadowTabs && tab.shadowTabs.length) {
            for (var k in tab.shadowTabs) {
                this.loadShadowTab($(tab.shadowTabs[k]));
            }
        }
        if (!Element.hasClassName(tab, 'ajax only')) {
            Element.removeClassName(tab, 'notloaded');
        }
        this.activeTab = tab;
    }
    if (varienGlobalEvents) {
        varienGlobalEvents.fireEvent('showTab', {tab:tab});
    }
},

从基本的阅读来看,我并不完全清楚让一个选项卡"依赖"另一个选项卡的含义。这是一个简单的"如果customer_options选项卡被渲染,则只渲染bundle_item选项卡"吗?还是更多?

这似乎意味着,无论何时显示绑定在一起作为shadowTabs的任何选项卡,该grop中的其他选项卡也将被渲染。

因此,不要"仅在渲染customer_options选项卡的情况下渲染bundle_item选项卡",而是"无论何时渲染bundle_item选项卡或customer_options选项卡,也渲染另一个"。

我不确定我喜欢阴影的比喻。