Page 1 of 1

Ext js show loadMask before document ready

Posted: Wed Dec 23, 2009 3:31 am
by Wolfie
Hi,


I have some problem showing and hiding loadMask (loading gif object in Ext js framework)

I am using zend framework and I have defined view .phtml which looks like this :

Code: Select all

 <?php echo $this->headScript()->setFile($this->baseUrl().'/scripts/ext/adapter/ext/ext-base.js') ?><?php echo $this->headScript()->setFile($this->baseUrl().'/scripts/ext/ext-all-debug.js') ?><script>var myMask = new Ext.LoadMask(Ext.getBody(), {msg:"Please wait..."});myMask.show();</script><?php echo $this->headScript()->setFile($this->baseUrl().'/scripts/test.js') ?> 
Here I am loading gif and showing it by myMask.Show()

Than in next file which is test.js i am trying to hide gif after document ready :

Code: Select all

 Ext.onReady(function(){     vp.render();    myMask.hide();}); 
Unfortunately, it doesn't works at all, first off all the loading image is showing after document is ready and than it doesn't hide ....so it's crap

please help...

Re: Ext js show loadMask before document ready

Posted: Wed Dec 23, 2009 4:19 am
by Wolfie
I have found some example and did similar but I still have some problem :

the example is here

the load gif shows while window is loading

My code looks like this :

Code: Select all

 var vp = new Ext.Viewport({       layout:'border',       items: borders,       listeners:{show:function() {           this.loadMask = new Ext.LoadMask(this.body, {           msg:'Loading. Please wait...'           });        }}   }); Ext.onReady(function(){     vp.render();}); 

But still doesn't work, please help..