展S开K双Y翼 2011-11-24 14:25
浏览 160
已采纳

EXT关闭WINDOW之后,再点击COMBO,报错

代码如下
var cf;

Ext.onReady(function() {
    Ext.QuickTips.init(true);
    cf = new CountryForm();
    cf.render(document.body);
});

CountryForm = Ext.extend(Ext.FormPanel, {
    id : 'CountryForm',
    title : '查询条件',
    frame : true,
    width : 1000,
    bodyStyle : 'padding:0 10px 0;',

    constructor : function(config) {

        var countryGroup = {
            xtype : "panel",
            layout : "form",
            columnWidth : 0.5,
            labelAlign : "right",
            labelWidth : 75,
            items : [ {
                xtype : 'fieldset',
                title : '标题',
                autoHeight : true,
                layout : 'form',
                collapsible : true,
                items : [ {
                    fieldLabel : 'ID',
                    xtype : 'combo',
                    mode : 'local',
                    triggerAction : 'all',
                    id : 'CountrySearchId',
                    name : 'CountrySearchId',
                    displayField:"gender",
                    store:new Ext.data.SimpleStore({
                        fields:["gender"],  
                        data:[["Male"],["Female"]]
                    })
                }]
            } ],
            buttons : [ {
                text : 'POP',
                onClick : doPop
            }]
        };

        CountryForm.superclass.constructor.call(this, {
            items : [ countryGroup ]
        })

    }
});

function doPop() {

    UpdateForm = Ext.extend(Ext.FormPanel, {
        id : 'CountryForm',
        frame : true,
        width : 1000,
        bodyStyle : 'padding:0 10px 0;',
        constructor : function(config) {

            var Country = {
                xtype : "panel",
                layout : "form",
                columnWidth : 0.5,
                labelAlign : "right",
                labelWidth : 75,
                items : [ {
                    xtype : 'fieldset',
                    title : 'sub',
                    autoHeight : true,
                    layout : 'form',
                    items : [ {
                        xtype : 'textfield',
                        name : 'name',
                        fieldLabel : 'name'
                    } ]
                } ]
            };
            UpdateForm.superclass.constructor.call(this, {
                items : [ Country ]
            })

        }
    });

    ResultWindow = function(config) {

        var updateForm = new UpdateForm();

        var buttons = new Array();

        var buttonClose = {
            text : '关闭',
            handler : function() {
                rw.close();
            }
        };

        buttons = [ buttonClose ];

        Ext.apply(this, {
            title : '修改画面',
            layout : 'fit',
            border : false,
            width : 450,
            height : 380,
            minWidth : 450,
            minHeight : 380,
            maximizable : false,
            resizable : false,
            constrainHeader : true,
            modal : true,
            items : updateForm,
            buttons : buttons
        });

        ResultWindow.superclass.constructor.apply(this, arguments);
    };

    Ext.extend(ResultWindow, Ext.Window);

    var rw = new ResultWindow();
    rw.show();

}
  • 写回答

5条回答 默认 最新

  • qq1988627 2011-11-24 15:19
    关注

    用 hide() 不要用close close 会把窗口对象销毁 再点击 就找不到对象了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog