Nov 25, 2008, 8:27 PM
[CLOSED] Visual error with default AjaxEvent Request Failure window
A couple of bugs/issues with the default AjaxEvent Request Failure window
1. The Error (X) image icon in the top left corner does not show up anymore.
2. Horizontal and vertical scrollbar show up even if content of HtmlEditor fits in current window. Ideally, scrollbar should be for the HtmlEditor and not the entire window.
3. If there's a window with an iframe and the window is smaller than 500 x 350, the Request Failure window is too big.
I was able to resolve issue 1 and 3 but not 2. Here's what I have so far. Maybe you guys can put some of the changes into the toolkit:
Coolite.Ext.AjaxEvent.override({
showFailure: function(response) {
var bodySize = Ext.getBody().getViewSize();
var width = (bodySize.width < 500) ? bodySize.width - 50 : 500;
var height = (bodySize.height < 350) ? bodySize.height - 50 : 350;
var win = new Ext.Window({
modal: true,
width: width,
height: height,
title: 'Request Failure',
layout: "fit",
maximizable: true,
listeners: {
"maximize": {
fn: function(el) {
var v = Ext.getBody().getViewSize();
el.setSize(v.width, v.height);
},
scope: this
}
},
items: new Ext.form.FormPanel({
baseCls: "x-plain",
layout: "absolute",
autoScroll: true,
defaultType: "label",
items: [
{
x: 5,
y: 5,
html: '<div class="x-window-dlg"><div class="ext-mb-error" style="width:32px;height:32px">
'
}, {
x: 42,
y: 6,
html: "Status code: "
}, {
x: 115,
y: 6,
text: response.status
}, {
x: 42,
y: 25,
html: "Status text: "
}, {
x: 115,
y: 25,
text: response.statusText
}, {
x: 0,
y: 42,
xtype: "htmleditor",
anchor: "100% 100%",
enableAlignments: false,
enableColors: false,
enableFont: false,
enableFontSize: false,
enableFormat: false,
enableLinks: false,
enableLists: false,
enableSourceEdit: false,
value: response.responseText
}]
})
});
win.show();
}
});