1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    14
    Vote Rating
    0
    aarnau is on a distinguished road

      0  

    Default Unanswered: How to add a listener on controller

    Unanswered: How to add a listener on controller


    Hi everyone.

    I have this controller.

    Code:
    Ext.define('deportes.controller.Controlador', {
        extend: 'Ext.app.Controller',
        views: ['HomePage', 'BuscadorEquipos'],
        //stores: ['Selectores'],
    
    
        refs: [
               {
                   ref: 'addFav',
                   selector: '#addFav'
               }
           ],
    
    
        init: function() {    
            this.control({
                '#addFav': {
                    'itemtap': function(){
                        //this.addTeamFavorites;
                        Ext.Viewport.setActiveItem({xtype:'homepage'});
                        //alert('shot');//this.addTeamFavorites
                    }
                }
            });
        }
    });

    And i want to make a behaviour when user press the id #addFav in the view "buscadorequipos". I tried to "click", "tap" and "itemtap" without any results.

    Code:
    Ext.define('deportes.view.BuscadorEquipos', {
        extend : 'Ext.form.Panel',
        alias : 'widget.buscadorequipos',
        config : {
            items: [
                    {
                        xtype: 'fieldset',
                        items: [disciplinas,modalidades,competiciones,equipos]
                    },
                    {
                        xtype: 'fieldset',
                        html: '<strong id="addFav">F</strong>'
                    }
                
                ]
        },
        initialize : function() {
            console.log("InitComponent for homepage");
            this.callParent();
        }
    });
    Can anyone help me?

    Thanks in advance.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,672
    Answers
    3354
    Vote Rating
    748
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Using this.control() uses ComponentQuery so it can only listen for Components which DOM elements are not Components. To do this, you would have to listen for when the component is rendered via this.control() and then set a listener on that dom element.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    14
    Vote Rating
    0
    aarnau is on a distinguished road

      0  

    Default


    Can you show me an example please?

Thread Participants: 1

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