1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    18
    Answers
    2
    Vote Rating
    0
    JohnM_ is on a distinguished road

      0  

    Default Answered: Adding item to a navigation view gives 'undefined method'

    Answered: Adding item to a navigation view gives 'undefined method'


    Hi guys,

    I've got a class which extends Ext.tab.Panel and a class which extends Ext.navigation.View nested within it.

    In my controller, I would like to add another Ext.navigation.View to the Ext.navigation.View which is already part of the tab panel so that when the tab panel is pushed to the main view, both views appear (nested within one another).

    In my controller, I've got refs:

    Code:
    //Views
    
    tabpanel: 'tabpanel',
    navview1: 'navview1',
    navview2: 'navview2',
    and I've got the code in a function which is attached to an event that is caught. How can I add navview2 to navview1, in order to get the same effect as if navview2 appears in navview1's items[] array?

    I've tried a number of permutations of the 'add' method, but keep getting 'undefined method' or similar, but the 'add' method clearly appears in the documentation under Ext.navigation.view, and the example provided has not been helpful. What am I doing wrong?

    Thanks!

  2. OK, I've got it. I was getting hung up on refs and xtypes, making it harder than it should have been. Here's the answer that I found.

    This works in the controller (screen, screen2, and screen3 are defined in their own files, and mainview is a ref to the 'main' view of my program):

    Code:
    var screen = Ext.create('TestProgram.view.Screen');
    var screen2 = Ext.create('TestProgram.view.Screen2');
    var screen3 = Ext.create('TestProgram.view.Screen3');
    
    
    screen2.add(screen3);
    screen.add(screen2);
    
    
    this.getMainview().push(screen);

  3. #2
    Sencha User
    Join Date
    Oct 2012
    Posts
    18
    Answers
    2
    Vote Rating
    0
    JohnM_ is on a distinguished road

      0  

    Default


    OK, I've got it. I was getting hung up on refs and xtypes, making it harder than it should have been. Here's the answer that I found.

    This works in the controller (screen, screen2, and screen3 are defined in their own files, and mainview is a ref to the 'main' view of my program):

    Code:
    var screen = Ext.create('TestProgram.view.Screen');
    var screen2 = Ext.create('TestProgram.view.Screen2');
    var screen3 = Ext.create('TestProgram.view.Screen3');
    
    
    screen2.add(screen3);
    screen.add(screen2);
    
    
    this.getMainview().push(screen);

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar