This is a migrated thread and some comments may be shown as answers.

disable mousewheel via javascript?

1 Answer 50 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 10 Jan 2017, 07:24 PM

On our page we have many RadNumericTextboxes.  I know we can use the 
IncrementSettings-InterceptMouseWheel="false" setting on an individual control.  I'd like to make that the default for all of them on the page.  I attempted to use this

$('.riTextBox').bind('mousewheel DOMMouseScroll', function (e) { e.preventDefault(); alert('abort');return false;});

I get my alert box so I know that the code is finding the correct controls, but it's not bypassing the mousewheel event.

 

 

The issue is that we have many developers working on this project and we don't want to have to remember to set the IncrementSettings-InterceptMouseWheel="false" flag every time that we add a new control.  It would be great if we could just tell all of them to diable it.  Is there another way to do this?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 13 Jan 2017, 02:13 PM
Hi Ryan,

You can set if the Numeric input should intercept the mouse wheel via the set_incrementSettings() method.

The code snippet below outlines the approach:

markup:

<telerik:RadNumericTextBox runat="server" ID="RadNumericTextBox1"></telerik:RadNumericTextBox>


JavaScript:


function pageLoad() {
    var numeric = $find("<%= RadNumericTextBox1.ClientID %>");
 
    numeric.set_incrementSettings({ InterceptMouseWheel: false });
}




Regards,
Viktor Tachev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
NumericTextBox
Asked by
Ryan
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or