1

I have carousel for 4 image tap

               this.add({
                   id: 'mainRow-' + index,
                   xtype: 'carousel',   flex:1,
                  defaults: {
                       flex:1
                   },       items: [
                                    {
                                         html: '<p><img src="image.jpg"></p>'
                                    },
                                    {
                                        html: '<p><img src="image.jpg">
                                    },
                                    {
                                        html: '<p><img src="image.jpg">
                                    }
                                ]
        });

I want to get which tap clicked.If user click first tap,firstview.js will be opened,for second tap,secondview.js.

My controller code is;

control : {
        root: {
            pop  : 'onRootPop',
            push : 'onRootPush'
        },
         "carousel" : {
             initialize : function(carousel){
                 carousel.element.on('tap', function(e, el){
                     // Here you will get the target element
                    // console.log(e.target, el);
                     Logger.log("fassss" + el);
                     EDevlet.app.getController('MainController').showNews();
                 }, this);
             }
         }
    }
},

if user click carousel ,initialize function work.But I have to get which tap clicked.(first second third)?.

tarikfasun
  • 314
  • 6
  • 16
  • yes i can do it after one days.It is easy. carousel.getActiveIndex() give me index current item.if user click first item ,it return 0, click second it return 1... – tarikfasun Nov 18 '15 at 13:29

0 Answers0