PDA

View Full Version : ExtJs 3.4. Closing window doesn't work in IE



johniman
16 Sep 2012, 11:31 PM
I'm using ExtJS version 3.4. After Ajax request, if it successfull - I need to close current window. For this I use window.close() function. It works for FF, Safari, Chrome, but not works for IE. I've trying to use hide() and destroy() functions but they not works too. Here is my code:


EditWindow = Ext.extend(GenericWindow, {

initComponent: function () {

var me = this;
var form = new EditForm({
supplierId: this.initialConfig.id,
url: urls.edit_supplier.replace("{id}", this.initialConfig.id)
});

var config = {
width:500,
height:450,
cls:'editSupplierWindow',
iconCls:'icon-edit',
title:msg.suppliers_edit_window_title,
border:false,
layout:'fit',
form:form,
items:[form],
buttons:[
{
text:msg.common_save,
cls:'edit-supplier-save-btn',
scope:this,
handler:function (options) {
if (this.form.getForm().isValid()) {
var data = Ext.util.JSON.encode(this.form.getForm().getValues(false));
Ext.Ajax.request({
url:this.form.getForm().url,
method:'POST',
jsonData:data,
closeAction:'close',
headers:{'Content-Type':'application/json'},
closeAction:'hide',
failure:function (form, action) {
console.log("Error save data on server");
},
success:function (form, action) {
console.log("Data successfully saved");
me.close();
}
});
} else {
Ext.MessageBox.alert('Errors', 'Please fix the errors noted.');
}
}
},
{
text:msg.common_cancel,
cls:'edit-supplier-cancel-btn',
scope:this,
handler:this.close
}
]
};


In IE console no any JS errors. Any ideas?

johniman
17 Sep 2012, 1:03 AM
I'm found the error reason!!! It happens bacause I use "console" object, but IE haven't it. I've remove console.log and it works.

scottmartin
17 Sep 2012, 5:15 AM
This is a known issue. Thanks for the update.

Scott.