Rather than using Ext.get()
, which returns a DOM element instead of a Sencha component, you likely want to just reference the view itself, which would have setScrollable()
.
onShow: function () {
var me = this;
// #canvasSignature is the id of the canvas that is loaded in the controller and placed in #canvasDiv
$("#canvasSignature").mousedown(function() {
me.setScrollable(false); //attempting to reference panel
}).bind('mouseup mouseleave', function() {
me.setScrollable(true); //attempting to reference panel
});
}
You could also override the Panel
's initialize()
method rather than needing to attach a listener.
initialize: function () {
this.callParent(arguments);
var me = this;
// #canvasSignature is the id of the canvas that is loaded in the controller and placed in #canvasDiv
$("#canvasSignature").mousedown(function() {
me.setScrollable(false); //attempting to reference panel
}).bind('mouseup mouseleave', function() {
me.setScrollable(true); //attempting to reference panel
});
}