PDA

View Full Version : disable mousewheel



excyberlabber
9 Aug 2012, 1:46 AM
Hi,

I have an editable treegrid (using Ext.ux.maximgb.tg.GridPanel), and when you click on a field, the htmleditor opens. When you click outside of the field, the value in the htmleditor (when changed) is automatically saved. However, NOT if you touch the mousewheel. If you move the mousewheel at all in Chrome, or outside the htmleditor in Firefox, then the htmleditor snaps shut without saving any value.

I have tried disabling the mousewheel in the body, so:

function turnOffMousewheel(e,target){
console.log('turning off mousewheel?');
e.stopEvent();
}
Ext.getBody().addListener('mousewheel',turnOffMousewheel);

And scrolling is turned off in the window. However, touching the mousewheel still causes the htmleditor to close suddenly without saving.

Any ideas what I can do? I have spent considerable time searching for an answer, but have found nothing for this specific issue. We are using Ext 3.3.1.

Thanks in advance!

scottmartin
9 Aug 2012, 10:40 AM
Do you want to disable across the board? Perhaps this this article will help:
http://www.stoimen.com/blog/2009/07/01/javascript-disable-mouse-wheel/

There are browser specific options.

Scott.

excyberlabber
9 Aug 2012, 11:34 PM
Thanks, Scott, for your answer. But the fact is, with the Extjs code above, I have stopped scrolling. It works in both Firefox and Chrome (the two browsers we are committed to supporting).

The problem is that touching the mousewheel, even though scrolling is turned off, still closes the htmleditor precipitously without calling the saving function. How can I disable the wheel itself? Or shelter the htmleditor from the effects of the mousewheel?