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