PDA

View Full Version : Problem with loadMask on a Window with loader config



mx_starter
20 Jun 2014, 8:37 AM
Hi guys,
please, take a look at this fiddle:

direct url: https://fiddle.sencha.com/fiddle/6sa/preview

6sa

It produces a simple modal window, which is configured with a loader config.
The loader itself is configured with a loadMask and set to be auto refreshed every 5 seconds - the idea is the Window to show the loadmask message while updating his contents.

Well - this works with every refresh, but not upon the first one, when the window is shown for the first time.

Is this a bug or i'm missing something?

Thanks in advance :)

glopes
20 Jun 2014, 3:22 PM
Seems to be a bug with 4.2.1 that was corrected on 4.2.2.

It was trying to display the loaderMask before the container was fully loaded.
An alternative is to set your code like this:



Ext.application({
name: 'Fiddle',


launch: function() {
//Ext.Msg.alert('Fiddle', 'Welcome to Sencha Fiddle!');


var myWindow = Ext.create('Ext.window.Window', {
title: 'Fiddle Window',
width: 250,
height: 200,
modal: true,
closable: true,
resizable: true,
autoScroll: true,
loader: {
url: 'data1.json',
loadMask: {
msg: 'Loading data...'
}
,listeners: {
load: function(loader, response, options) {
loader.startAutoRefresh(5000);
}
}
}
});

myWindow.show(null, function(){
this.getLoader().load();
});
}
});


But there is still a bug with the position of the loader. Try using a newer version of the library.

mx_starter
21 Jun 2014, 2:09 AM
:) Tried (within the fiddle) using all the versions above 4.2, including the two from the 5.0.0 branch and the result is the same.

You can see it yourself - just click the Open in Fiddle link

glopes
21 Jun 2014, 12:16 PM
Take a look at my fiddle using ExtJS 4.2.1.
You will notice that the first load places the loader to the left....
But if you change the ExtJS version to 4.2 - Nightly or 5.... this doesnt happen.


https://fiddle.sencha.com/#fiddle/6su

6su (https://fiddle.sencha.com/#fiddle/6su)

mx_starter
22 Jun 2014, 10:51 PM
Yeah, i can see that....
Another important thing to remember is that closing the window DOES NOT destroy the loader and if you forget to destroy it upon window's close - you will finish with an infinite loader refreshes