1. #1
    Sencha User cyberwombat's Avatar
    Join Date
    Oct 2011
    Posts
    237
    Vote Rating
    2
    Answers
    6
    cyberwombat is on a distinguished road

      0  

    Default Unanswered: Proper way to access viewport from a card

    Unanswered: Proper way to access viewport from a card


    I have a navigationview for my viewport:

    Code:
    Ext.define('App.view.Viewport', {
        extend: 'Ext.NavigationView',
        xtype: 'viewportview',
    I need to access the viewport from within a card (either the controller or the view - Id like to know how to do both).

    I have created a ref in my card as:

    Code:
    Ext.define("App.controller.Dashboard", {
        extend: "Ext.app.Controller",
        config: {
            refs: {
                'viewport': 'viewportview',
    Now I would like in this case to access the navigationbar of the viewport. I would like to know how to do this from either the controller init() or the matching view onShow() method.

    In the controller init() the call to this.getViewport() returns undefined - I assume the ref is not created then. I then tried Ext.Viewport.getNavigationBar() but that is also undefined and also seems to be a no no as to accessing the viewport.

    So how do I do this in B3?

    Thanks

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Answers
    17
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Viewport is a singleton. Ext.Viewport is a common reference to it.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 1