我想添加处理程序以在combobox的选择器滚动上滚动事件,但不会触发滚动事件。
Ext.define('Test.MyCombo', {
extend:'Ext.form.field.ComboBox',
createPicker: function() {
var me = this,
picker = me.callParent(arguments);
me.mon(picker, {
'afterrender' : function() {
picker.getTargetEl().on('scroll', function(){
console.log('scroll?');
}, me);
},
scope: me
});
return picker;
},
});
答案 0 :(得分:1)
你应该听Picker而不是targetEl。
Ext.define('Test.MyCombo', {
extend:'Ext.form.field.ComboBox',
createPicker: function() {
var me = this,
picker = me.callParent(arguments);
picker.on('scroll', function(){
console.log('scroll?');
}
return picker;
},
});
答案 1 :(得分:0)
您需要注册活动' schroll'渲染你的组合框时
listeners: {
render: function(p){
p.body.on('scroll', function(){
// do stuff
}, p);
}
}