1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    49
    Vote Rating
    3
    Answers
    2
    svendahlstrand is on a distinguished road

      0  

    Default 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:

    Code:
    Ext.defer(function () {
      var settings = this.getSettings();
    
    
      Ext.getStore('Cards').each(function (card) {
        settings.add({xtype: 'settingscard', card: card});
      });
    }, 500, this);
    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.

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Location
    Düsseldorf, Germany
    Posts
    587
    Vote Rating
    32
    Answers
    34
    Kurt001 has a spectacular aura about Kurt001 has a spectacular aura about

      0  

    Default


    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?

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    49
    Vote Rating
    3
    Answers
    2
    svendahlstrand is on a distinguished road

      0  

    Default


    Hi and thanks for your help Kurt! I will try with a new example:

    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);
      }
    });
    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?

Thread Participants: 1