Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui-grid height not working as expected #2500

Closed
cheeverm3 opened this issue Jan 7, 2015 · 12 comments
Closed

ui-grid height not working as expected #2500

cheeverm3 opened this issue Jan 7, 2015 · 12 comments

Comments

@cheeverm3
Copy link

I create a ui-grid with ui-grid-auto-resize without any height specified on the div and the following grid options set:

maxVisibleRowCount: 8,
minRowsToShow: 1

I would expect it to show one row regardless of the list count and then grow until it reaches 8 after which the scrollbars will be used to see the other rows. Instead the height of the ui-grid doesn't change (only 1 shown) and you have to scroll to see anything else. It seems like minRowsToShow is acting like maxRowsToShow and the grid doesn't grow to show the maxVisibleRowCount. If i remove minRowsToShow and set maxVisibleRowCount = 3 it shows probably like 10 rows which makes no sense. Lost and looking for any help. As an aside the gridUtil.elementHeight method is empty without a return?

@PaulL1
Copy link
Contributor

PaulL1 commented Jan 11, 2015

The maxVisibleRowCount option has been recently removed, as you noted it did nothing.

I don't think the grid dynamically grows in height, it sets it's height once based on some rather obscure logic.

@PaulL1 PaulL1 added this to the 3.0 milestone Jan 11, 2015
@cheeverm3
Copy link
Author

A better way might be to simply have a grid option properties that allow the user to set either a height or a max-height for the viewport. That would cover both use cases where either the user wants a fixed height to start with or the user wants the grid to grow to a max-height after which scrolling will be required. The reason i need the latter is that currently with the fixed height if you only have one row but a height that can accomodate 10 the column separators don't extend down to the bottom making the grid look funky.

@aidanlister
Copy link

How can we get a full height grid?

@aidanlister
Copy link

This seems to work:

<div ui-grid="gridOptions" class="grid" style="height: {{gridOptions.data.length*30}}px" ui-grid-cellNav ui-grid-auto-resize ui-grid-edit></div>

@Karttin
Copy link

Karttin commented Mar 12, 2015

style="height: {{gridOptions.data.length*30}}px" not working for IE? any suggestions pls

@PaulL1
Copy link
Contributor

PaulL1 commented Mar 28, 2015

Sounds like another flavour of #3031, linking to that so they're tied together in case someone decides to implement it.

@PaulL1 PaulL1 modified the milestones: Future, 3.0 Mar 28, 2015
@shenlong
Copy link

@Karttin, do use ng-style instead:
ng-style="{height: (gridOptions.data.length*30)+32+'px'}"

I have added the 32 for the header as well. Cheers.

@deveshkumar303
Copy link

it is not showing complete data in the grid. Please suggest to adjust height auto on the basis of number of Rows.

@codeofsumit
Copy link

I was under the impression that ui.grid.autoResize would just fit the grid to whatever the container is, but even with fixed values that isn't the case. It works about 50% for width, never for height.

@chakraborty-slx
Copy link

chakraborty-slx commented Jul 28, 2017

http://brianhann.com/make-ui-grid-take-up-the-whole-page/
This post resolved my issue.
http://plnkr.co/edit/cJpklhSFheWgsbbAg0JT?p=preview
.grid {  height: 98vh;}

@stale
Copy link

stale bot commented May 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 23, 2018
@stale
Copy link

stale bot commented Jun 22, 2018

This issue has been automatically closed because it has not had recent activity. If you believe that this is still an issue in the latest version, feel free to re-open it. Thank you for your contributions.

@stale stale bot closed this as completed Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants