Search code examples
handsontable

Deactivate the scrollbars in handsontable


In handsontable, is it possible to show a deactivated scrollbar?

I want to show the scrollbar when the number of rows are more than the viewport, but still wants to deactivate the visible scrollbar. Is there any solution available for this?


Solution

  • I got it how do deactivate the visible scrollbars in HandsOnTable.

    There are Disable and Enable methods defined in WalkOnTable(3rd party used within HandsOnTable). It can be used to disable to mouse clicks on ScrollBar.

    Also we need to capture the mousewheel event in the control to capture the mousewheel event and prevent it to propagate.

    1. $( '.htCore' ).on( 'mousewheel', function ( e ) { if (someCondition) { e.stopPropagation(); } } );

    2. _handsOnTableCoreInstance.view.wt.wtScrollbars.vertical.dragdealer.enable();