1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Answers
    1
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default Answered: On tab icon tap

    Answered: On tab icon tap


    Something I have found incredibly difficult is to listen for tab icon taps in a controller. I have tried to the following selectors and more

    Controller:
    Code:
    control: {
                'mytab':{
                    tap:'onTabTap'
                },
                'mytab button[action=myHomeButton]':{
                    tap:'onTabTap'
                },
    
    
            }

    In the end I went for the actual tab change
    Code:
    'myhome':{
                    activate:'onTabTap'
                }

    My view:
    Code:
    Ext.define("BibleVerse.view.Main", {
        extend: 'Ext.tab.Panel',
        requires: ['Ext.TitleBar'],
        xtype:'mytab',
        
        config: {
            tabBarPosition: 'bottom',
            items: [{
                xtype:'myhome',
                action:'myHomeButton'
            },{
                xtype:'mysettings'
            }]
            
        }
    });
    Any ideas?

  2. Try this selector:

    Code:
    mytab tab
    The tab panel has a child tab bar and the tab bar has child tabs.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Answers
    3364
    Vote Rating
    756
    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


    Try this selector:

    Code:
    mytab tab
    The tab panel has a child tab bar and the tab bar has child tabs.
    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.

  4. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Answers
    1
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    Try this selector:

    Code:
    mytab tab
    The tab panel has a child tab bar and the tab bar has child tabs.
    Thanks for your response

    Still no luck

    Code:
    'mytab tab':{
                    tap:function(){alert('help')}
                }

    Update: sorry - my mistake didnt upload properly.. Thanks for that! Worked like a treat

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Answers
    3364
    Vote Rating
    756
    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


    Just saw your update. Prepared a simple test case, maybe it will help others:

    Code:
    Ext.define('Test.controller.Main', {
        extend : 'Ext.app.Controller',
    
        config : {
            control : {
                'tabpanel tab' : {
                    tap : 'onTabTap'
                }
            }
        },
    
        onTabTap : function() {
            console.log('tap');
        }
    });
    
    Ext.application({
        name : 'Test',
    
        controllers : [ 'Main' ],
    
        launch : function () {
    
            new Ext.tab.Panel({
                fullscreen : true,
                items      : [
                    {
                        title : 'One'
                    },
                    {
                        title : 'Two'
                    }
                ]
            });
    
        }
    });
    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. #5
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    63
    Answers
    1
    Vote Rating
    1
    stevanicus is on a distinguished road

      0  

    Default


    Thanks for that! I'm sure it will

  7. #6
    Sencha User
    Join Date
    Apr 2012
    Posts
    70
    Vote Rating
    0
    mukeshgla is on a distinguished road

      0  

    Default


    hi Mitchell,

    As per your code whenever i click on any Tab One or Two "tap" is printed on console, but I want it to recognize the tabs tapped. i.e. I should be able to distinguished if tab one or Two is pressed?

    Thanks & Regards
    Mukesh pandey

  8. #7
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,735
    Answers
    3364
    Vote Rating
    756
    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


    The tab instance is the first argument in the onTabTap method. Or you can change the control statement to be a different selector.
    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.

Thread Participants: 2

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