disable mousewheel via javascript?

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    1 posts
    Member since:
    Jan 2017

    Posted 10 Jan Link to this post

    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?

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1595 posts

    Posted 13 Jan Link to this post

    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.
Back to Top