1
我已經定義了一個傳送帶。Sencha Touch`directionLock` - 我哪裏錯了?
Ext.define('rpc.view.bible.indexView', {
extend: 'Ext.Carousel',
alias: 'widget.bible-indexView',
direction: 'horizontal',
directionLock: true,
config: {
items: [{
xtype: 'toolbar',
title: 'Bible Reading Plan',
docked: 'top'
}, {
xtype: 'bible-_chapterADayView'
}, {
xtype: 'bible-_bibleInAYearView'
}]
},
initialize: function() {
console.log('rpc.view.bible.indexView ~ initialize');
this.callParent();
}
});
兩者bible-_chapterADayView
和bible-_bibleInAYearView
是擴展的Ext.Panel局部視圖。
他們按預期工作,但我在this bug report中的滾動問題仍然存在,即使我已實施directionLock。
我在哪裏出錯我的directionLock實現?
我也試過了以下兩種方法。
Ext.define('rpc.view.bible.indexView', {
extend: 'Ext.Carousel',
alias: 'widget.bible-indexView',
config: {
scrollable: {
direction: 'horizontal',
directionLock: true
},
items: [{
xtype: 'toolbar',
title: 'Bible Reading Plan',
docked: 'top'
}, {
xtype: 'bible-_chapterADayView'
}, {
xtype: 'bible-_bibleInAYearView'
}]
},
initialize: function() {
console.log('rpc.view.bible.indexView ~ initialize');
this.callParent();
}
});
和
Ext.define('rpc.view.bible.indexView', {
extend: 'Ext.Carousel',
alias: 'widget.bible-indexView',
scrollable: {
direction: 'horizontal',
directionLock: true
},
config: {
items: [{
xtype: 'toolbar',
title: 'Bible Reading Plan',
docked: 'top'
}, {
xtype: 'bible-_chapterADayView'
}, {
xtype: 'bible-_bibleInAYearView'
}]
},
initialize: function() {
console.log('rpc.view.bible.indexView ~ initialize');
this.callParent();
}
});
directionLock配置應始終位於最內層傳送帶上。它基本上告訴框架內部可滾動區域優先於最外部區域。 – rdougan 2012-02-15 07:01:20
而使用Ext.define創建新類時,所有* configs應該在config:{}塊內。如果您使用Ext.create或通過將對象傳遞給.add()來創建實例,則不需要將配置放入配置塊中。 – rdougan 2012-02-15 07:02:29
@rdougan,所以**所有**配置的含義'extend','別名'和'初始化'也? – 2012-02-15 15:17:02