PDA

View Full Version : content of a variable not displayed in IE and Chrome



marxan
4 Jul 2013, 1:44 AM
Hello,

I'm doing the following to display a date update in a label xtype (I need to use html because, I've also added images and a couple of links:
You can check the result here:
http://ec.europa.eu/economy_finance/db_indicators/tab/

In my ViewPort view: I want to add the content of my Global variable: Global.lastUpdate.


initComponent: function () { var me = this;
Ext.applyIf(me, {
layout: 'border',
items: [
{
region: 'north',
layout: 'hbox',
items:[
{
xtype: 'label',
flex: 1,
height: 105,
html: ' Tax and Benefits' +
' <div id="imgbreadcrumbs"></div> <i> (Last update: ' + Global.lastUpdate +
' ) </i> <div id="imgright"></div> </div> </div>'
}

In my main controller: I load the data through a store and then load it in Global.lastUpdate


init: function () { var me = this;

me.setGlobalLastUpdate();
...

setGlobalLastUpdate: function ()
{

storeLastUpdate = Ext.getStore('LastUpdateStore');
storeLastUpdate.load({
scope: this,
callback: function(records, operation, success)
{
lastDate = storeLastUpdate.data.first().data.lastDate;
lastDate = lastDate.substring(0,10);
Global.lastUpdate = lastDate;
}
});



This code works fine with Firefox but not in IE and Chrome. I guess it's because the Global.lastUpdate is filled with the value after displaying the label.

Any idea how I can correct this?

Thanks,

Marxan

slemmon
8 Jul 2013, 10:31 AM
Which runs first: the initComponent method or the storeLastUpdate callback?