Saulis / iron-data-table

iron-data-table is a Web Component for displaying data as a table or grid. Built on top of iron-list using Polymer.
Apache License 2.0
147 stars 66 forks source link

Feature Request: Truncate string on overflow and add full text as toltip #119

Closed sravan-s closed 7 years ago

sravan-s commented 8 years ago

Would like to have an inbuilt property to handle overflown text, as in here: overflow

I have implemented a fix in my branch: feature/cell-overflow-ellipsis. The results are something like this. ellipsis

If you guys think this is a valid request, I'll raise a pull request.

Saulis commented 8 years ago

Hi!

Interesting suggestion – I have a few questions about the implementation. Can the ellipsis be set directly to <data-table-cell> so that an extra <span> isn't needed? If yes, I think this could be set as a default style so that a property ellipsis is not needed.

Also, I'd leave out setting any values to the title; I'm worried making assumptions that innerHTML contains the correct value (it might have HTML).

sravan-s commented 8 years ago

@Saulis I'll try out your suggestion on putting style directly on data-table-cell. I really need that text on hover. Any ideas for implementing it? Actually, I put the 'span' inside data-table-cell to implement that text over hover.

sravan-s commented 8 years ago

Well, I checked it. But ellipsis seems to have some problems with display: flex. We are using dispaly: flex on data-table-cell. Wrapping text inside a container seems to help.