简体   繁体   English

是否可以覆盖sencha touch轮播的上一个和下一个功能?

[英]is it possible to override sencha touch carousel previous and next functions?

I am using sencha touch to develop mobile website. 我正在使用sencha touch开发移动网站。

Ext.setup( {
    onReady: function() {

      new Ext.Carousel({
        fullscreen: true,
        items: [
          {
            html: "Item1"
},
{ 
  html : "Item2"
}
]});};});

is what i use. 是我用的。 But is it possible to override next() and prev() functions. 但是可以覆盖next()和prev()函数。 Actually i want to do something inside those function and then call parent.next() i mean same function . 实际上我想在这些函数中做一些事,然后调用parent.next(),我的意思是相同的函数。 Any help?? 有帮助吗? I saw the link http://www.sencha.com/forum/showthread.php?110036-Override-Method But i cant understand that 我看到了链接http://www.sencha.com/forum/showthread.php?110036-Override-Method但我无法理解

Refer this code for your requirement. 请根据您的要求参考此代码。

Ext.Loader.setConfig({
    enabled: true
});

Ext.application({
    launch: function () {
        Ext.define('MyApp.view.inbox.MyInbox', {
            extend: 'Ext.Carousel',
            config: {
                itemId:'test',
                fullscreen: true,
                items: [{
                    html: "Item1"
                },{ 
                    html : "Item2"
                }]
            },
            next:function(){
                //Do your thing

                //This code will call the next in the super class
                this.callParent(arguments);
            },
            prev:function(){
                //Do your thing

                //This code will call the prev in the super class
                this.callParent(arguments);
            }
        });
        Ext.create('MyApp.view.inbox.MyInbox');
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM