1. #1
    Ext Premium Member yyogev's Avatar
    Join Date
    Jun 2009
    Location
    Shoham, Israel
    Posts
    196
    Answers
    5
    Vote Rating
    6
    yyogev is on a distinguished road

      0  

    Question Answered: How do I remove the "loading" mask from a store on exception ?

    Answered: How do I remove the "loading" mask from a store on exception ?


    I have a grid panel where in some cases the load errors might return an error message. I have found that I can catch this in the 'exception' event in the proxy.
    However, I could not figure out how I can unmask the grid so the "loading" mask will disappear when the error is encountered.

    Any help will be appreciated.
    Yaron Yogev

    IT Software Developer

  2. Code:
     Ext.getCmp("my_grid").getView().setLoading(false);

  3. #2
    Ext Premium Member yyogev's Avatar
    Join Date
    Jun 2009
    Location
    Shoham, Israel
    Posts
    196
    Answers
    5
    Vote Rating
    6
    yyogev is on a distinguished road

      0  

    Thumbs up setLoading(false) on the grid view does the trick

    setLoading(false) on the grid view does the trick


    Code:
     Ext.getCmp("my_grid").getView().setLoading(false);
    Yaron Yogev

    IT Software Developer

  4. #3
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Answers
    3
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      1  

    Default exception event on stores is never fired

    exception event on stores is never fired


    There's one line in ExtJS code that shows that Sencha thought about hiding the mask on exceptions.

    bindStore in LoadMask.js
    Code:
    me.mon(store, {
        scope: me,
        beforeload: me.onBeforeLoad,
        load: me.onLoad,
        exception: me.onLoad
    });
    However, the exception event on stores is never fired. The code exists in all versions from 4.0.0 till 4.1.1.
    I use this override to bubble the exception event of a proxy to the store.
    Code:
    Ext4.define('Ext.override.data.AbstractStore', {
    	override: 'Ext.data.AbstractStore',
    
    	constructor: function()
    	{
    		this.callParent(arguments);
    		// exception-Event hinzufügen
    		this.addEvents('exception');
    	},
    	setProxy: function(proxy)
    	{
    		var me = this;
    		// bei altem Proxy Listener entfernen
    		if (me.proxy && me.proxy.isProxy)
    			me.mun(me.proxy, 'exception', me.onProxyException, me);
    
    		proxy = me.callParent(arguments);
    
    		me.mon(proxy, 'exception', me.onProxyException, me);
    		return proxy;
    	},
    	onProxyException: function()
    	{
    		var args = Ext4.Array.from(arguments);
    		args.unshift('exception');
    		this.fireEvent.apply(this, args);
    	}
    });
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

  5. #4
    Ext Premium Member yyogev's Avatar
    Join Date
    Jun 2009
    Location
    Shoham, Israel
    Posts
    196
    Answers
    5
    Vote Rating
    6
    yyogev is on a distinguished road

      0  

    Default


    Perhaps the coupling of onLoad with the 'exception' event was supposed to do the hiding of the 'loading' mask ?
    Yaron Yogev

    IT Software Developer

  6. #5
    Sencha User makana's Avatar
    Join Date
    Apr 2008
    Location
    Dresden, Germany
    Posts
    527
    Answers
    3
    Vote Rating
    19
    makana has a spectacular aura about makana has a spectacular aura about

      0  

    Default


    Yes, that's what I mean. I think they intent to hide the mask (that is what onLoad does) on exceptions. but they don't bubble the exception event from proxy to the store, so there's no exception event on stores. The mentioned override is to bind the exception event to the store.
    Programming today is a race between software engineers striving to build bigger and better іdiot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)

    Enhanced ExtJS adapter for Adobe AIR

Thread Participants: 1

Tags for this Thread