tbar : [{
id : 'addDiction',
text : '新增',
iconCls : 'option',
handler : function() {
var form =new Ext.form.FormPanel({
layout : 'table',
layoutConfig : {
columns : 2
},
defaults : {
layout:'form'
},
items:[
{items: [tdictiontype]},
{items: [ttypename]},
{items: [tcode]},
{items: [tccode]},
{items: [tcname]},
{items: [tdictionno]},
{items: [ttsort]}
],//items
url: "/d9inn/diction.do",
baseParams: {method: "addDiction"},
method: "post",
buttons: [{
text: "新增",
handler: function(){
var back = {
success: function(f, action){
Ext.Msg.alert("成功", action.result.msg);
store.reload();
win.close();
},
failure: function(){
Ext.Msg.alert("错误", "对不起,操作失败,请检查数据是否完整!");
}
};
form.getForm().submit(back);
}
},{
text: "取消",
handler: function(){
win.close();
}
}]
});//FormPanel
var win = new Ext.Window({
title: "修改字典信息",
id: "edit",
width: 500,
modal: true,
autoHeight: true,
items: [form]
});
win.show("editEmployee");
}
}]
以上是我的部分源码,当我每次重新加载页面之后,第一次点击导航条上的增加按钮时,可以正确弹出页面的,可是我第二次点击增加按钮时fireFox就会出现如下错误信息:
Operation is not supported" code: "9
[Break on this error] window.undefined=window.undefined;Ext=...window.attachEvent("onunload",a)}})();
http://localhost:8181/d9inn/js/ext-base.js Line 7
希望各位高手帮我解决下 谢谢!
哦。。。明白了,建议你将window改为复用
即将closeAction配置为"hide",这样关闭窗口也不会销毁
编辑和新增可以共用表单的,不过显示前注意设置数据。
信息不足,建议开发时做以下处理:
将页面引用的ExtJs库换成未压缩的debug版
ext-base.js -> ext-base-debug.js
ext-all-debug.js -> ext-all-debug.js
发布时再换回去
给Firefox安装firebug插件
错误很明显是 第一次关闭window会对里面销毁。第二次的时候tdictiontype等等组建都应经销毁了。所以出现错误。
你可以对window 窗口缓存,第二次点击直接使用缓存的window 窗口就行了。
添加window 属性。
closeAction: 'hide',
{
text: "取消",
handler: function(){
win.hide(); //让其隐藏。
}