1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    thehyperadvisor is on a distinguished road

      0  

    Default Push view to navigationview using controller in SA2

    Push view to navigationview using controller in SA2


    I'm trying to just push a panel view into a navigationview using a controller which is listening for a tap of a button. When i code this by hand i can use the code below in the controller and it works fine. This however does not work in architect.

    ----------------------------------
    control: {
    'home #Docs':{
    tap: function(button, e, options) {
    var placesView = Ext.create('FirstApp.view.CmdList');
    this.getMain().push(placesView);
    }
    }
    }
    -----------------------------------
    Here is the error i get "Uncaught TypeError: Cannot call method 'push' of undefined "

    I am new the sencha but sencha architect is not really making the coding process easy for me here. Could someone provide a simple example? I have looked at the examples from sencha and they're not really helping me out. Thanks.

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Posts
    350
    Vote Rating
    1
    bharatn is on a distinguished road

      0  

    Default


    Do you have a controller reference called 'main' that has a selector referencing the NavigationView?

    Seems like you dont.
    Bharat Nagwani
    Sencha Designer Development Team

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    thehyperadvisor is on a distinguished road

      0  

    Default


    Thanks, that did help me look in the right direction. I had the reference but the alias:"main" was not set on the navigationview which is what I was using for the reference. I also change up the code a bit and it now works with the code below which is different from how it works when I didn't use sencha architect.

    ----------------------------
    Ext.define('MyApp.controller.Home', {
    extend: 'Ext.app.Controller',
    config: {
    refs: {
    main: 'main',
    home: 'home',
    cmdlist: 'cmdlist'
    },


    control: {
    "home #Docs": {
    tap: 'onDocsTap'
    }
    }
    },


    onDocsTap: function(button, e, options) {


    this.getMain().push({
    xtype: 'cmdlist'
    });
    }


    });
    --------------------------------

Thread Participants: 1

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