PDA

View Full Version : [CLOSED] Window Loading Mask v2.0rc1



softmachine2011
Jun 22, 2012, 7:59 AM
Hi,

I open windows with js like this:



var w = new Ext.Window({
renderTo: Ext.getBody(),
modal: false,
resizable: true,
maximizable: false,
minimizable: false,
collapsible: false,
draggable: true,
isMinimized: false,
isMaximized: false,
isModal: false,
constrain: true,
loader: {
url: top.ResolveUrl(url),
renderer: 'frame',
noCache: true,
loadMask: {
showMask: true,
maskMsg: Ext.String.format(top.App.Global.Textos.sm_aviso_c argando, parentTab.title)
}
});


And maskMsg is ignored, and in beta 3 works correctly.

Vladimir
Jun 22, 2012, 8:32 AM
I can reproduce mask misaligning only
You have to define a size for the window

softmachine2011
Jun 22, 2012, 8:35 AM
Well, full code is this, but it have custom vars of my project.



var w = new Ext.Window({
area: namespace.area,
parentTab: parentTab,
closeUrl: baseRestUrl + 'Release/' + ci,
restUrl: baseRestUrl,
renderTo: Ext.getBody(),
title: parentTab.title,
iconCls: parentTab.iconCls,
initialTitle: parentTab.title,
CI: ci,
itemCI: itemCI,
itemID: Ext.isEmpty(command.itemID) ? top.App.Store.getProperty(store, ci, namespace.identificador) : command.itemID,
itemDetailChanged: false,
modal: false,
resizable: true,
maximizable: false,
minimizable: false,
collapsible: false,
draggable: true,
isMinimized: false,
isMaximized: false,
minimizePosition: -1,
originalWidth: namespace.detailWidth,
originalHeight: namespace.detailHeight,
restoreTop: undefined,
restoreLeft: undefined,
minWidth: namespace.detailWidth,
minHeight: namespace.detailHeight,
width: namespace.detailWidth,
height: namespace.detailHeight,
onClose: namespace.HasChanged,
isModal: false,
constrain: true,
sortInfo: store.sorters.items[0],
recordIndex: Ext.isEmpty(paginationCriteria) ? (grid.getSelectionModel().getCount() > 0 ? grid.getSelectionModel().getSelection()[0].index : 0) : paginationCriteria.index,
totalRecords: totalRecords,
referenceWindow: namespace,
tools: [{
type: 'minimize',
handler: function (event, toolEl, panel) {
App.Windows.MinimizeWin(w);
}
},
{
type: 'restore',
hidden: true,
handler: function (event, toolEl, panel) {
App.Windows.RestoreWin(w);
}
},
{
type: 'maximize',
handler: function (event, toolEl, panel) {
w.isMaximized = true;
w.maximize();
w.tools["maximize"].hide();
w.tools["restore"].show();
}
}],
loader: {
url: top.ResolveUrl(url),
renderer: 'frame',
noCache: true,
loadMask: {
showMask: true,
maskMsg: Ext.String.format(top.App.Global.Textos.sm_aviso_c argando, parentTab.title)
},
listeners: {
load: function (control) {
control.target.iframe.dom.contentWindow.parentWind ow = control.target;
}
}
},
directEvents: {
hide: {
fn: function (el) {
if (!Ext.isEmpty(this) && !Ext.isEmpty(this.closeUrl) && this.closeUrl.length > 0 && Ext.isEmpty(this.deleteRegistryRequest))
Ext.Ajax.request({
cleanRequest: true,
url: top.ResolveUrl(this.closeUrl),
method: "POST",
failure: function (result, request) {
top.App.Events.errorHandler(this, request, result);
}
});
},
delay: 20
}
}
});


I define the size and more things. But maskMsg in loader is ignored and it appears 'Loading...' instead of custom message.
There is a thread with similar problem with markup windows.

http://forums.ext.net/showthread.php?19581-CLOSED-Window-LoadMask

Daniil
Jun 22, 2012, 9:31 AM
Hi,

Well, according to the thread you mentioned you should use "msg" instead of "maskMsg".

Also please use "disableCaching" instead of "nocache".

These changes are noted in SVN changelog #71.

Daniil
Jun 22, 2012, 9:48 AM
Also please do not define "directEvents" manually on client side. The <DirectEvents> section is designed to define DirectEvents on server: in code behind or ASPX markup.

On client side you can just use "listeners" instead of "directEvents".

softmachine2011
Jun 22, 2012, 9:53 AM
Yes in rc1 works with this changes.

But in beta3 still works with old code, it seems that was a bug.

Thanks

Daniil
Jun 22, 2012, 10:01 AM
Yes, there was a bug. Now you should use "Msg" on server and "msg" on client.

softmachine2011
Jun 22, 2012, 10:46 AM
Ok ok, I have done so.

It was only you knew

Thanks again.