ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

Disable Vertical Scroll

Open mbitson opened this issue 11 years ago • 11 comments

Hey There!

I've been going through the options for the UI Grid and I love it. I'm having some issues with how it scrolls, though. Having the UI grid scroll seperately from the page creates some undesirable controls for the user- scrolling is difficult and confusing if they're mid scrolling and suddenly it stops and starts scrolling the UI Grid instead of the page. Would it be possible to have the UI grid adjust it's height to always match the number of entries being shown? I can't find any docs on this- I have disabled the scrollbar (both horizontal and vertical, and each individually for testing) but I can't get the grid to adapt it's height to the number of entries- instead it just hides the bar and operates just as it would with the scroll bar.

Is this something I'm overlooking? I've looked through the tutorial docs and the api docs but I can't find anything that seems to address this. I'm also coming up empty on google. Just let me know!

Thank you!

mbitson avatar Mar 27 '15 15:03 mbitson

The way the grid scrolls is the same as when you scroll over a textarea.

Lots of people have requested a plugin that makes the grid automatically adjust its height, and it's definitely high on the list for getting out the door.

c0bra avatar Mar 27 '15 16:03 c0bra

Hello,

I'm also looking forward to have this feature available.

Thanks.

bielmenezes avatar Mar 27 '15 17:03 bielmenezes

Excellent! Great to know it's on the radar! Thank you!

mbitson avatar Mar 27 '15 18:03 mbitson

I'm also interested in this. Has there been any progress?

billbither avatar Sep 21 '15 16:09 billbither

Is there any progress on this feature?

Demian87 avatar Sep 23 '15 19:09 Demian87

Has there been any progress on this? This seems like a very high priority to me... without a good user experience, the grid can't be used.

JewelsJLF avatar Jan 04 '16 02:01 JewelsJLF

Thanks for all of your work on this project! It's been extremely helpful getting a new feature out the door. I just wanted to throw in that I'd also love to have this feature. I'm programmatically adding columns and rows for UI purposes and it's weird to be able to scroll some data out of view.

ghost avatar Jan 22 '16 00:01 ghost

Here's a solution I'm using that may be what some of you are looking for.

* - Create a function to calculate the table height based on the number of rows.*

$scope.calculateHeight= function() { var numRows= 75; // Set value based on page size, or calculate with $scope.gridOptions.data.length var addHeight= 60; // Optional value. I added this because my vertical scrollbar kept appearing for only 2 more rows (out of 75 total) return { height: (length * $scope.gridOptions.rowHeight + $scope.gridOptions.headerRowHeight + marginHeight ) + "px" }; };

* - Add needed values to $scope.gridOptions*

$scope.gridOptions = { data : 'myData', rowHeight: 30, headerRowHeight: 84 // I'm also using external filtering, sorting, and pagination, along with paginationPageSizes, paginationPageSize, paginationCurrentPage, and totalItems: 0 }

* - Include 'ui.grid.autoResize' in angular.module('myApp', ['ui.grid', 'ui.grid.autoResize'])*

** - Add the function to your table **

<div id="grid1" ui-grid="gridOptions" class="grid" ui-grid-auto-resize="" ng-style="getTableStyle()"></div>

The end result for me is only a single vertical scrollbar for the page, none for the grid itself, and a full grid with 75 rows of data. Hopefully this helps.

alexpavia avatar Mar 16 '16 13:03 alexpavia

+1

csvan avatar Oct 18 '16 08:10 csvan

Any update on the same. Is this issue resolved?

rphit2110 avatar Jan 03 '17 12:01 rphit2110

Bizarre that bind-scroll-vertical and bind-scroll-horizontal are not configurable. Though it is Angular.

mryellow avatar Nov 16 '23 01:11 mryellow