1. #1
    Sencha User
    Join Date
    Sep 2010
    Location
    Austria
    Posts
    59
    Vote Rating
    2
    samlinux is on a distinguished road

      0  

    Default TabPanel events

    TabPanel events


    Hi,
    which event is fired, if one tap ist clicked, in ST1 there was a click event?

    In ST2 i can`t find an event, which I can use in my controller to catch the tap event ???



    PHP Code:
    Ext.define('App.controller.Main',{    
    extend'Ext.app.Controller',
        
    // registriere die views    

    views: [        
      
    'Desk1'    
    ],    
    refs: [        
       {            
          
    ref'myTab',            
          
    selector'#myTab'        
       
    }    
    ],     

    init: function(){        
      
      if(
    _debug)console.log("Controller gestartet");

      
    this.control({

           
    '#myTab' : { show 'handleItemChange'}        
        });

        },
        
    handleItemChange: function(){        
             
    console.log("test");    
        }
    }); 

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,533
    Vote Rating
    871
    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


    tap events are on the elements, not components.
    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

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Location
    Austria
    Posts
    59
    Vote Rating
    2
    samlinux is on a distinguished road

      0  

    Default


    Is the post below also the reason why my control function do`t catch the tap event ??


    PHP Code:
    this.control({
        
    '#myTab': { 
            
    tapthis.onKlick
        
    }
    }); 
    PHP Code:

    Ext
    .define('App.view.Desk1', {    
    extend'Ext.tab.Panel',    
    alias'widget.viewDesk1',    
    id'myTab',    
    config: {        
    fullscreentrue,        
    activeItem0,        
    tabBarPosition'bottom',        
    cardSwitchAnimation: {            
       
    type'slide',           
       
    covertrue        
    },        
    defaults: {            
    scrollable'vertical',            
    styleHtmlContenttrue        
    },        
    items: [            
    {
    title'B1'iconCls'info'id'tab1',html:'test 1'},            
    {
    title'B2'iconCls'user'id'tab2'html'test2'}        ]

        },    
    initialize: function(){        
    this.callParent();        
    this.element.on({           
       
    tap: function(){               
        var 
    activeTab Ext.getCmp("myTab").getActiveItem();
        if(
    _debug)console.dir(activeTab.title);
            
    console.log("klick in View");

            }        
        });    
      }

    }); 

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,533
    Vote Rating
    871
    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


    this.control cannot listen to elements, just components. What I usually do is add the listener in my class definition in the initialize method and then fire that event on the component and then this.control can then listen for it.

    Code:
    initialize : function() {
        var me = this;
    
        me.callParent(arguments);
    
        me.element.on({
            scope : this,
            tap : 'bubbleTapEvent'
        });
    },
    
    bubbleTapEvent: function(e, t) {
        this.fireEvent('tap', this, e, t);
    }
    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.

  6. #6
    Sencha User
    Join Date
    Sep 2010
    Location
    Austria
    Posts
    59
    Vote Rating
    2
    samlinux is on a distinguished road

      0  

    Default


    thanks man, it works now

Thread Participants: 1