容器中的按钮重复自身 - ExtJS

Buttons in Container Repeats itself - ExtJS

我在 ExtJS 的容器内使用了两个按钮,我在单选按钮上显示的容器被选中。但是当我打开表单时再次按下取消按钮时,按钮会重复出现。这是 xds:

{
    "id": "MyContainer39",
    "cid": "container",
    "jsClass": "MyContainer39",
    "snapToGrid": 10,
    "userConfig": {
        "flex": "-ext-undefined-",
        "autoRef": "SelectContainer",
        "id": "SelectContainer"
    },
    "cn": [{
        "id": "MyButton20",
        "cid": "button",
        "jsClass": "MyButton20",
        "snapToGrid": 10,
        "userConfig": {
            "text": "MCW.lr.s_btn_selectAll",
            "style": "float:left; display:inline-block; margin-left:10px;",
            "flex": "-ext-undefined-",
            "autoRef": "SelectAll"
        }
    }, {
        "id": "MyButton21",
        "cid": "button",
        "jsClass": "MyButton21",
        "snapToGrid": 10,
        "userConfig": {
            "text": "MCW.lr.s_btn_deselectAll",
            "iconAlign": "right",
            "style": "float:left; display:inline-block; margin-left:15px;",
            "flex": "-ext-undefined-",
            "autoRef": "DeSelectAll"
        }
    }]
}

单选按钮检查条件:

if (card.internalServerDowloadLocation.checked == true) {
    Ext.getCmp('SelectContainer').show();
} else {
    Ext.getCmp('SelectContainer').hide();
}

有什么办法吗,取消时我可以从容器中删除按钮,然后在加载时再次将其添加到容器中。

我自己解决了。主要问题是在容器中 autoref 和 id 是相同的:

"userConfig": {
        "flex": "-ext-undefined-",
        "autoRef": "SelectContainer",
        "id": "SelectContainer"
    }

所以我删除了 autoref 并且它现在工作正常。