Results 1 to 3 of 3

Thread: After push event for NavigationView

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    49
    Answers
    2
    Vote Rating
    3
      0  

    Default 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
    Dsseldorf, Germany
    Posts
    594
    Answers
    35
    Vote Rating
    33
      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
    Answers
    2
    Vote Rating
    3
      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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •