Results 1 to 2 of 2

Thread: Catch a tap event of a carousel in controllers control: definition

  1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default Catch a tap event of a carousel in controllers control: definition

    I would like to to catch a tap event on a carousel in the control section of a controller. Like:

    control: {
    mycarouselView: {
    initialize: 'initMycarousel',
    tap: '
    react-on-tap'
    }


    Initialize fires but not tap. That is, how I learnt in Stackoverflow forum, because the event goes to the element of a carousel, not the carousel itself. So I put following code into the initialize function of my carousel:

    carousel.element.on( 'tap' , function(e, el) {
    react-on-tap();
    }, this);

    This works fine, but then I define my events at two different locations. Is there a way to get it done in the control-definition?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      1  

    Default

    The carousel component doesn't have a tap event which is what the control config in the controller is going to listen for. The tap event is on the element so the controller cannot listen to it, you need to fire an event on the carousel component for the controller to hear the event.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •