[CLOSED] LoadMask hide in javascript does not seem to be working

  1. #1

    [CLOSED] LoadMask hide in javascript does not seem to be working

    Hello,
    I have 2 javascript functions as shown below and the mask seems to load fine but does not go away when i call the "HideMask" function.

    I am using .Net framework 4.6.1 & ext.net 3.3.0 on Windows 8.1.

    var ShowMask = function ( obj , message )
    {
    	var oMask = new Ext.LoadMask( { msg: message , target: obj } );
    
    	oMask.show();
    };
    
    var HideMask = function ( obj )
    {
    	var oMask = new Ext.LoadMask( { msg: "", target: obj } );
    
    	oMask.hide();
    };
    Last edited by fabricio.murta; Mar 22, 2016 at 9:23 PM.
  2. #2
    Hello @edip!

    Can you try defining oMask in the global space (outside the JavaScript functions) and on hide, just reusing the first defined mask .hide() method?

    I'm not sure what your requirements are but I hope this can get us started!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello Fabricio,
    Yes that works, thank you. Is there no way to get a reference to the existing mask without using the global variable?

    Thanks.
  4. #4
    Hello @edip!

    Yes, there is one! Actually I was wondering why you are using `new` to instance a new mask. There should be one at all times you can just show and hide!.. I just thought for some reason you couldn't use this on your use case. Maybe you can, after all!

    Like as with
    Ext.getBody().mask()
    And unmask() on the same getBody() to remove it. You can do this at the level of any component! Like, for example
    App.GridPanel1.unmask()
    Where you have a component which ID is GridPanel1.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Thanks Fabricio, that works perfectly. There is no reason to do it any other way...it was just code that someone had written & I did not know any better.
  6. #6
    Glad it helped! Thanks for confirming it works for you!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] GridViews loadMask sometimes not working
    By blueworld in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 20, 2013, 2:03 PM
  2. Replies: 1
    Last Post: Nov 28, 2011, 7:20 AM
  3. Ext.msg.hide() not working
    By Argons in forum 1.x Help
    Replies: 1
    Last Post: Jul 30, 2009, 2:33 AM
  4. How to hide/show ImageButton in JavaScript?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Jun 16, 2009, 3:47 PM

Tags for this Thread

Posting Permissions