[英]is it possible to override sencha touch carousel previous and next functions?
我正在使用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');
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.