3.2.0

Mouse Wheel not working in version 2.0.1

I can't seem to get the mouse wheel to work at all in version 2.0.1 whenever the mouse is over the grid. I tried the following function, but it doesn't work in version 2.0.1:

function onmousewheel(event){
var scrollbars = this.getTemplate("layout").getContent("scrollbars");
var delta = scrollbars.element().offsetHeight * event.wheelDelta/480;
scrollbars.element().scrollTop -= delta;
}
obj.setEvent("onmousewheel", onmousewheel);


Any ideas?
Brian McCrary
November 21,
*bump*
Brian McCrary
December 12,
The mouse wheel should work with AW 2.0.1 by default, without any additional code, both in IE and FF. Are you saying that it doesn't work in your environment?
Alex (ActiveWidgets)
December 12,
Alex,

Yes, it is not working in my environment. I am using I.E. 6.
Brian McCrary
December 13,
Alex,

An update: the mouse wheel works whenever the grid itself has a scrollbar, but does not work whenever I have a grid that is larger than the screen itself, e.g. 500 rows.
Brian McCrary
December 13,
*bump*
January 9,
ok, as far as I understand you actually want to disable mouse wheel event handler in the grid -

obj.getScrollTemplate().setEvent(AW.ie ? "onmousewheel" : "onDOMMouseScroll", "");
Alex (ActiveWidgets)
January 9,
um, no. i want it to work in the grid. see my last update on this from December 13th.
January 17,
Sorry, I don't understand. You've said that the mouse wheel works whenever the grid has scrollbar and does not when it hasn't. But this is exactly how it should be? If there is no scrollbar there is nothing to scroll.

I thought that you want to scroll the page, not the grid (?).
Alex (ActiveWidgets)
January 17,
Sorry for the confusion. Let me try to state it better:

I have a grid with 500 rows. This grid, of course, goes off my screen vertically. The grid itself does not have a vertical scrollbar (I made the height of the grid greater than the 500 rows tall), but the page that it is in does. Whenever my cursor is over the grid and I try to move the mouse wheel, nothing happens. It used to in version 1.x, but does not in version 2.01.

Now, if I take the same grid with 500 rows and make the height of that grid *smaller* than the height of 500 rows (i.e. the grid itself has a scrollbar), then the mouse wheel works just fine.

Brian McCrary
January 17,
Version 1.x has a bug in mouse wheel processing - the event is not canceled and both grid and the parent page will scroll where possible. In v2 you have to disable mouse wheel event processing in the grid (to allow the event bubble into the parent page) and then the page will be able to scroll when mouse is above the grid.
Alex (ActiveWidgets)
January 17,
Alex:

Thanks, it appears I was the one confused. :) That worked perfectly!
Brian McCrary
January 17,

This topic is archived.

See also:


Back to support forum