Hide horizontal scrollbar (Angular ui-grid)

Andreas N. picture Andreas N. · Sep 24, 2014 · Viewed 41.9k times · Source

I'm trying to hide the horizontal scrollbar of a Angular ui-grid, but I can't find the right property. (Property enableScrollbars=false removes both.)
Is it possible to remove only the horizontal scrollbar?

Answer

nabinca picture nabinca · Nov 14, 2014

With the latest version on Github v3.0.0-rc.16 you can disable horizontal and vertical Scrollbar separately. Instead of

enableScrollbars = false;

use

enableHorizontalScrollbar = value; 
enableVerticalScrollbar = value;

with

value = 0; /* NEVER */
value = 1; /* ALWAYS */
value = 2; /* WHEN_NEEDED */

UPDATE: If you want to use constants instead of the integer-value, look at corresponding post:

Using ui-grid constants to disable scrollbars

UPDATE: The option WHEN_NEEDED doesn't seem to be available at the moment. Maybe this will be changed again, so please look for the available constants in the source code.

The Constants are defined in

https://github.com/angular-ui/ui-grid/blob/master/packages/core/src/js/constants.js