-
24 Jan 2013 2:22 AM #1
Unanswered: After push event for NavigationView
Unanswered: After push event for NavigationView
Hello!
Is it possible to listen for an "after push finished" event on NavigationView? The view I'm pushing takes a while to populate so I want to show a "Loading" text from the start and defer populating the view until the push and it's animations are ready.
Right now I'm doing this in the event handler:
That doesn't feel good though! Is there another way? A related question: is it possible to cache the pushed view somehow? Right now I'm always creating a new one when pushing.Code:Ext.defer(function () { var settings = this.getSettings(); Ext.getStore('Cards').each(function (card) { settings.add({xtype: 'settingscard', card: card}); }); }, 500, this);
-
24 Jan 2013 5:30 AM #2
Can you write in a few sentences what you want to do here?
You do add your views to the settings and add a component to each view. Is that what you are doing?
And then you want to wait until the first view shows up?
-
24 Jan 2013 5:47 AM #3
Hi and thanks for your help Kurt! I will try with a new example:
As you see I'm defering my expensive (slow) code 500 ms so that the push animation can finish. But instead I would like to listen for another event, like "pushAndAnimationFinished". Do I make any sense?Code:Ext.define('Settings', { extend: 'Ext.app.Controller', config: { refs: { navigationView: 'navigationview', }, control: { navigationView: { push: 'prepareSettings' } } }, prepareSettings: function () { Ext.defer(function () { // Here I'm doing something expensive that can take // several seconds. I'm using defer to avoid UI freeze. }, 500, this); } });


Reply With Quote