Ui grid height dynamically

By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Previously when using the Kendo UI Grid control version Now, since I upgraded to the latest version of the controls The HTML for that row now contains the in-line style of the below, whereas previously it did not.

I'm guessing this is the problem. I want to know if there's a way to turn off this feature or where in the scripts I can remove this. I can't even find when this was introduced in the release history!

EDIT: I've identified the problem lies within the kendo. If I use the old one, everything works fine You might consider providing your own CSS to adjust the Grid. I've provided an example here. The main CSS that would interest you being:. You can read more about this on the Telerik forums.

Following up from Cody's CSS, the problem was found in the kendo. I used the entire new set of files from Not sure what's changed in those files, as I ran a comparison and couldn't spot the offending line. Learn more. Asked 5 years, 6 months ago.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. Is there a way to make the row height dynamic so if say text is too long and wraps that the row will increase in height to accomodate? If not is this something that is even possible in the future?

No, unfortunately. In order to properly virtualize large amounts of data, UI-Grid needs to know how big every row will be.

Eventually we would like to be able to specify different heights, per-row, but allowing dynamic heights would require measuring every row post-render, which would cause the browser to thrash and thus poor performance. So what can we do in the meantime? Set every row higher to accommodate the few that are wrapping? I have rows that are occasionally wrapping and getting cut off, and I really don't want to go back to jquery DataTables :.

Virtualization is a brilliant feature, one of the main reasons I turned to ui-grid. But for certain tables I would happily trade virtualization for dynamic row height. Any chance we could have eventually an option of dynamic row height, that we turn on for datasets that we judge to be small enough? Or would even, say, a dataset of fewer than rows still thrash the browser? Because I really, really don't want to go back to Jquery DataTables : ui-grid is so much better for so many things.

I think there are two different things here. The first is configurable row height per row. We have an idea of how we'd implement this, it means that we have to add up the heights of all the rows to get the overall canvas height, and there's some trickery in scrolling, but it's not impossible and according to c0bra not too dissimilar to how we process columns.

I note that column scrolling is much less performant than row scrolling, but I hope that's not due to this logic. The second is dynamic row height based on the content. Arguably this is an extension to the above, but uses some mechanism to first calculate all the row heights, then store them on each row.

This could be external to ui-grid, or could be a feature that plugs onto ui-grid. Doing this properly means rendering the cell and then measuring it, but it could be possible to do it less properly if necessary. Ultimately if it is something we only do once, on data ingestion, and if we were able to do that in a background thread perhaps, then it might not be a big deal.In this article, you will learn how to customize UI-Grid height dynamically based on record count list.

Intro When we use UI-Grid with paging and load data from the database, then we provide constant height for that grid but sometimes the grid has fewer records and then we see some blank space in the bottom of the grid.

So this article is about how to get rid of that blank space and customize grid height dynamically based on record count. Now we have records list based on custom paging. In a given screenshot, as you can see, the grid has five records but still I can see some unused space in the bottom.

As you can see in given screenshot, record count is five then grid has height accordingly. As you can see in screenshot 3, I put record count as 10 and the grid height automatically increased. If you have any questions or comments, drop me a line in the comments section. View All. Raj Kumar Updated date, Sep 23 Add the following function after adding previous article code.

Now go back to html and add this style in UI-Grid. Next Recommended Article. Getting Started With. NET 5. Getting Started with ML. NET Core.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. This my current grid show via ng-grid: There some text was cut because it too long. I want to show unbroken data in each cell, so I add some style for grid:. After setted this style, the grid show like this: The text show complete.

But the style of grid goto irregularity. Now I want achieve that effect: In general, after the grid loaded, it show like the frist picture above.

If one cell's text too long, when mouse hover or on click, then heighten the row which current cell at, so that it could display complete data. Now, I binded click event at a cell, to get parent row element in JQuery, then change it css like above. The code just like:. Which version of the grid are you using? I had thought that it wasn't possible to have different row sizes per row, so I'm impressed with how far you've gotten.

What is the problem that you have - you say "the style of the grid go to irregularity" - does that mean you want all the rows the same height, and don't like some being a different height than others? If so, I think this is an easier thing to achieve than each row having their own height. Yes, I want all rows in same height. If one row has excessive text, when click this row, its height change, and other row keep fixed height. I think I successfully set row height on 2. I don't have that original work to hand now I've upgraded to 3.

I'm currently using ui-grid - v3. I'm also looking for a way to have all rows at a set height and when someone clicks on the cell, then resize the row to auto-height and wrapping the cell contents. Do we have a plunker for this? Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up. New issue. Jump to bottom. Labels waiting-response.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account.

ui grid height dynamically

At the moment we solve this by changing the container height based on the number of rows in the grid but it would be nice to be able to tell ui-grid to not be constrained by a specific height so that all rows are visible without the grid itself having to scroll its fine if the page needs to be scrolled.

While this can be done by setting the container height to something massive, it leaves lots of bordered whitespace which looks bad. An add-on feature that just resizes the grid to show all of its rows and not would be very fairly easy, and has been requested a couple times, but there's doesn't seem to be anyone interested in actually putting in the time to develop it.

It will probably get done once higher priority items get checked off. Yes but minRowsToShow can only be set once and you get a lot of empty whitespace if you don't actually have that many rows. If the number of rows keeps changing and you want the grid to adjust for that, how would you get away from having to resize the element every time? Well, as long as a specific height isn't set, the element should just keep growing. The problem is that it keeps growing into a specific height container, thus scrollbars.

ui grid height dynamically

I think the only way to do this would be to have a resizer based on the number of rows - there's no other way to know how large the grid should be made. There could be value in having this part of the grid, in that the grid already knows how high rows are.

I'd imagine it would need to do something like:. I have a similar issue. I have filterable data with a functional footer, and this leads to nasty whitespace when the search is used and reduces the size to less than the container.

Ideally the grid should respect a min-height and max-height attribute and scroll when needed. And what would be nice is simply to paint filler rows e. I wouldn't mind having 5 rows added if the filtered set is less than the min-height.

I basically just resize the container based on the number of rows plus the header and allow auto-resize to handle the rest. Hi guys, I have a similar problem. It depends on how you're doing it. If you are retrieving the data via http, then likely gridOptions.

If you are setting gridOptions. I'd need to see more of your code to be sure, but the easy way is to set a breakpoint at the time that this code runs, and check what's in gridOptions. Here code of my controller: app. You could move the minRows into the http response, but that may be too late. On 25 Novat pm, BrodaUa notifications github. The length stay by default - 10 rows. Please consider this another request for the grid's container element to just grow as tall as it needs to be to fit all the content.

Insert view to GridLayout dynamically, with even width and height

I don't need scrollbars either. Sorry to jack the thread. Here's my work around for anyone trying to make a grid dynamic height based upon visible rows.

I had to set gridOptions. Thank you. Once the data is loaded I just resize the container, in my case based on 25px per row and 25px per line of header and 25px to keep the scroll bar clear of the bottom.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. How do I get ng-grid to auto resize its height based on the page size? The documentation on ng-grid's site uses a fixed height.

Dynamically Change the Page Size of the Grid to Adjust Its Height

The best solution I've seen comes from this link :. This does not work with server-side paging. You can try using the ng-grid Flexible Height Pluginall you need to do is add this plugin to the plugins property in grid options and he'll take care of the rest. If you don't want to add any plugins I've implemented an easy solution to dynamically change the table's height strictly based on the visible rows. I am using Ui-Grid-Unstable v3.

No need to touch CSS. I find using this piece of code on the stylesheet solved my problem. I disabled the plugin but it works either way. In the method where you are trying to store the data for each row within each grid, add a code to calculate the length of the grid in a separate array and push that calculated length to different array. Make sure the index of the grid and index of the array should be same, so that we can access it from the UI together.

My approach was as follows:. Learn more. Asked 5 years, 11 months ago. Active 3 years, 1 month ago. Viewed 31k times. CalebG CalebG 1 1 gold badge 2 2 silver badges 7 7 bronze badges. Active Oldest Votes. Alex Choroshin Alex Choroshin 6, 2 2 gold badges 24 24 silver badges 35 35 bronze badges. Agreed, worked perfectly for me. The plugin moved since master is now 3. Sajid Ali, as far as I know, ui-grid already has a support for dynamic height.

Hope this helps! Belter Belter 2, 1 1 gold badge 28 28 silver badges 40 40 bronze badges. Nehal 1, 4 4 gold badges 16 16 silver badges 30 30 bronze badges. Fan super Fan super 1. David Villacis C. Purnima Nagpal Purnima Nagpal 1.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service. The dark mode beta is finally here. Change your preferences any time. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information.

ui grid height dynamically

Previously when using the Kendo UI Grid control version Now, since I upgraded to the latest version of the controls The HTML for that row now contains the in-line style of the below, whereas previously it did not. I'm guessing this is the problem.

I want to know if there's a way to turn off this feature or where in the scripts I can remove this. I can't even find when this was introduced in the release history! EDIT: I've identified the problem lies within the kendo. If I use the old one, everything works fine You might consider providing your own CSS to adjust the Grid. I've provided an example here. The main CSS that would interest you being:. You can read more about this on the Telerik forums.

Dynamically set grid height

Following up from Cody's CSS, the problem was found in the kendo. I used the entire new set of files from Not sure what's changed in those files, as I ran a comparison and couldn't spot the offending line. Learn more. Asked 5 years, 6 months ago. Active 5 years, 6 months ago.

Viewed 7k times. Can you replicate in dojo. That will help us troubleshoot. Active Oldest Votes. Hi welcome to StackOverflow, please include code snippets directly in your answer vs. This removed the problem, specifically the css:. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.


comments

Leave a Reply

Your email address will not be published. Required fields are marked *