我正在使用sencha touch开发手机网站。
Ext.setup( {
onReady: function() {
new Ext.Carousel({
fullscreen: true,
items: [
{
html: "Item1"
},
{
html : "Item2"
}
]});};});
是我使用的。但是可以重写next()和prev()函数吗?实际上,我想在这些函数中做一些事情,然后调用parent。next(),我的意思是相同的函数。任何帮助吗?我看到了链接http://www.sencha.com/forum/showthread.php?110036-Override-Method但是我不能理解
根据您的需求参考此代码。
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');
}
});