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

Variable row heights

Open orneryd opened this issue 14 years ago • 24 comments

Allow for variable row heights on a row-by-row basis

orneryd avatar Nov 19 '12 04:11 orneryd

Pretty, pretty feature! Is known when it'll done?

timothyklim avatar Dec 17 '12 07:12 timothyklim

Not for a while. I have been looking into this and it will take a lot of re-working the core grid to get this feature going.

orneryd avatar Dec 18 '12 00:12 orneryd

Also the row height should have an 'auto' config to adjust to content height, if i have a cell with a small width but extended content (being text or other elements) i want it to span other lines ex: i found no way to place a long name in a short cell as (it gets appended with "...") that is not cool, i cant replace my tables as they will not convey information the way i want em to

other then that (WOW thank you guys!!!) .... no, really ... WOW

Agamennon avatar Dec 30 '12 21:12 Agamennon

What you can do in the meantime is just set the row height to a larger size and use a simple cell template to wrap the text around. The ellipses are just there to show that there is more data and you can double click the header resize grip and it will resize the column to the lenght of the represented data. You could also have a popover or a title that shows the entire text contents of the cell when moused over, just an idea. I have some ideas for the examples that I want to put on there, some more advanced master/detail stuff and things like this.

Right now the way virtualization works is that the rows are all position absolute and of a fixed height. In order to get auto heights we would have to change the whole CSS. (Which I am not opposed to doing)

On Sunday, December 30, 2012, Agamennon wrote:

Also the row height should have an 'auto' config to adjust to content height, if i have a cell with a small width but extended content (being text or other elements) i want it to span other lines ex: i found no way to place a long name in a short cell as (it gets appended with "...") that is not cool, i cant replace my tables as they will not convey information the way i want em to

other then that (WOW thank you guys!!!) .... no, really ... WOW

— Reply to this email directly or view it on GitHuhttps://github.com/angular-ui/ng-grid/issues/21#issuecomment-11768854

-Tim Sweet

orneryd avatar Dec 30 '12 22:12 orneryd

@timothyswt any chance you could whip up a quick plunker that does text wrapping for a cell. i've been hacking on row + cell templates for a while, but not quite achieving it yet.

davisford avatar Jan 23 '13 20:01 davisford

here are some links for word wrapping in a div:

http://www.w3schools.com/cssref/css3_pr_word-wrap.asp http://webdesignerwall.com/tutorials/word-wrap-force-text-to-wrap

orneryd avatar Jan 23 '13 21:01 orneryd

looks like @maxcan made a plugin for this https://github.com/angular-ui/ng-grid/blob/master/plugins/ng-grid-flexible-height.js

orneryd avatar Feb 05 '13 00:02 orneryd

Thanks. I will check it out. I did resolve it separately - noted in a different issue https://github.com/angular-ui/ng-grid/issues/107

davisford avatar Feb 05 '13 01:02 davisford

I did not understand how the plugin mentioned resolves the purpose of having configurable row heights ?, So if i have 2 rows and there heights should be based on the contents in them will the plugin help ? .. I just tried it out how it does not seem to fit the bill

sudarshan89 avatar May 26 '13 10:05 sudarshan89

I'd like to add my request to see a demo or plunker how this allows for variable row heights. Seems to me this allows for variable grid heights, but if I want to implement an "expand" row to show extra content, this doesn't quite fit the bill for that.

yilativ avatar Jul 04 '13 16:07 yilativ

This is closed, but was it ever resolved?

ghost avatar Sep 16 '13 13:09 ghost

I was never able to get the variable row height plugin to work at all, which is probably because I misunderstood its scope.

I wound up making a local fork of ngGrid which allows for different rows to have dynamically variable heights, to support expanding rows (e.g., click on the "+" icon to see details) and an "edit entire row at a time" mode (i.e., double click on a row and all fields become editable, with "Save" and "Cancel" buttons below the row being edited). It could easily be extended to allow different rows to have different heights based upon the entity data. It works, but it's ugly and inelegant and doesn't pay a lot of attention to angular-ish conventions, and I doubt it would be easy to convert this to a plugin. Also, I've made no attempt to make it work with local data stores (this is for a data-heavy enterprise app with a RESTful backend), and in particular no effort to get it to work with aggregation.

If anyone is interested, I'll push my fork to github.

frogomatic avatar Sep 18 '13 05:09 frogomatic

@frogomatic, I'd be interested in checking out your fork. Thanks!

ribbitfix avatar Sep 26 '13 17:09 ribbitfix

@frogomatic, we also interested. Many thanks.

jenghung avatar Oct 03 '13 13:10 jenghung

@frogomatic how is the project going?

ThCC avatar Oct 24 '13 18:10 ThCC

Hello, I'll wrap it up this weekend and post; I got bogged down with a work deadline. Thanks for your patience.

frogomatic avatar Oct 30 '13 16:10 frogomatic

https://github.com/frogomatic/ng-grid

Sorry this took so long. See README.frogomatic for details. Implements variable row height, row-level editing with Save/Cancel buttons below rows, row expansion (click expand tab and load additional content below the row ... note that this is all part of the same grid row), and a few miscellaneous other changes.

frogomatic avatar Nov 07 '13 01:11 frogomatic

BTW, the actual modified ng-grid JS file is n-grid.frogomatic.js. I didn't modify the files in the source tree (sorry, sloppy practice I know, this was done as part of a rush job)

frogomatic avatar Nov 07 '13 18:11 frogomatic

Thanks @frogomatic. I've started looking at ng-table which seems like it might provide an easier way to create variable row heights.

ribbitfix avatar Nov 08 '13 22:11 ribbitfix

Why is this a closed issue? Is there a solution??

I am using the css from http://stackoverflow.com/questions/19094723/angular-ng-grid-row-height

This doesn't seem to be the best solution though.

timothyjlaurent avatar Mar 13 '14 17:03 timothyjlaurent