Disable Vertical Scroll
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!
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.
Hello,
I'm also looking forward to have this feature available.
Thanks.
Excellent! Great to know it's on the radar! Thank you!
I'm also interested in this. Has there been any progress?
Is there any progress on this feature?
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.
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.
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.
+1
Any update on the same. Is this issue resolved?
Bizarre that bind-scroll-vertical and bind-scroll-horizontal are not configurable. Though it is Angular.