-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Only the first row is visible #80
Comments
You need to manually set a height to your ngGrid class. .ngGrid { |
hmm... Essentially this way I will set height for all grids on my page - right? What if I have several grids with different sizes? |
Right. You'll probably need to add a class for each grid you want to set at a different height. .ngGrid { .ngGrid.grid1 { .ngGrid.grid2 { Or something like that. |
and then what? The ngGrid class is assigned to an internal div by the ngGrid javascript programmatically. Is there a way to control it? |
The ngGrid class is added to the div that you use the ng-grid declaration on in your html. Here's a plunker for an example: http://plnkr.co/edit/hUZvR3 |
Sorry. This is a joke Plunker played on me. I changed the height on the grid div but Plunker decided to ignore the change. Only after I refreshed the entire thing the change actually took. I got it now, |
Sorry the plunker didn't work. Apparently it stopped saving my changes late last night. So yes, the plunker was jacked up. Plunker seems to be having issues this morning also so I'm not yet able to fix it. On another note, I'm trying to help you. There's no need to be rude. |
Wow, man, no way I intended to be rude. When I was talking about Plunker, it was about me using Plunker to play with my own stuff, not about your plunk. I plyed with the grid in my own plunk and it was throwing me off all the way, that's why I posted the issue. I do appreciate your effort and you did point me in the right direction. If you feel slighted, I apologize, really. I am just learning the ropes here, and every step takes some effort, so when Plunker throws another monkey wrench I feel a little frustrated. |
Ah. No sweat. No worries. Yes, plunker does decide to jack things up I've had that happen to me before as we'll. Some things just decide to stop I'm glad you got it working though. It's very nice when you get something On Jan 4, 2013, at 8:38 AM, Michael Feingold notifications@github.com Wow, man, no way I intended to be rude. When I was talking about Plunker, it was about me using Plunker to play I do appreciate your effort and you di point me in the right direction. If — |
Actually, the real issue is the that the script is interpreting I should note for those who aren't aware and reading this from Google or something that the use of !important is very very bad practice, but I'm cool with it here as a work around while the script is being updated so frequently. Thanks for that by the way. |
I am not sure if this is the right thing to do, but I got my answer and therefore I feel like closing this issue |
the height: auto !important workaround is not working for me. |
Experienced this today, did someone forgot to fix this before closing the issue? |
any updates on this issue??? Hello, i am adding rows dynamically to ng grid. issue: i have one parent div in which height is set to 650 px its like i tried auto option for height also in parent div as mentioned in https://github.com/angular-ui/ng-grid/issues/80..but no success Please advise as this is very critical for us. thanks HTML Structure: ""div id="div-report" class="report-container" CSS: } .gridStyle } |
height: auto !important is not working. There is a trick to calculate the height depending on the no.of records in the gid. So if you have 10 records, then the height of your grid is 10*30 + 32 = 332. Calculate the height by using your data like [(gridData.length)*30 + 32](here gridData is the object you are assigning to your grid) and use some jquery code in your js file to assign this height to your gridStyle class. |
I guess you cannot call it "best practice" but for my very specific needs, this css workaround is was enough: .ngViewport.ng-scope{
height: auto !important;
overflow-y: hidden;
}
.ngTopPanel.ng-scope, .ngHeaderContainer{
width: auto !important;
} |
Thanks eitankw, |
I used eitankw's solution with a minor change:
It worked, but then requirements changed and I had to increase the min-height to 400px. When loading up the grid, there is a scroll bar down the right side that is the full 400px, but the rows stop about halfway down the viewport (6 rows are visible). When the browser window is resized, the rows suddenly fill the full 400px. It's no different with height or min-height, and all parent containers are at least 400px in height. Is there a reason why it would fix the first time, but not the second? |
In 2.0.7 the following works for me: .ngViewport.ng-scope { The following is because i want it to occupy the whole page in width:.ngViewport.ng-scope > .ngCanvas { .ngViewport.ng-scope > .ngCanvas > .ng-scope { |
Hi .ngViewport { |
Has someone solved the "6 rows" issue? It's driving me crazy |
For me it seems like virtual scrolling is the cause of the problem. I could manage my way out of 6 rows issue by increasing virtualizationThreshold (default is 50 items) so that the grid won't get virtualized. |
Why is there no way for ng-grid to dynamically set it's height based on the content being iterated over. It seems very sloppy to hardcode a pixel height... |
Because measuring each row after its rendered while you're scrolling quickly will be horrendous performance-wise. There's lots of other virtualization products, ionic had one. They fine allow dynamic heights either and this is why. |
I copy pasted the code from the getting started page posted here - the grid shows up, but only the first row is visible, and even that not completely. It turns out that the div with the class ngViewport has its height explicitly set to 0. What am I doing wrong? How can I control the height of the visible portion of the grid?
The text was updated successfully, but these errors were encountered: