Question

I love the dojo enhancedgrid, but am having a few issues:

What I am trying to accomplish:

I have a description column in my grid that can range from 10 characters up to 300 characters long. I want the text to wrap when it won't fit on one line in the cell and the height of each row to automatically increase to hold the description.

I have seen pictures of this working, but cannot make it work.

What works:

If I do not put the rowHeight parameter in my grid spec, the text does word wrap which is good.

What doesn't work:

If I specify a rowHeight, the text doesn't wrap even if there is plenty of room in the row for it to wrap to the next line.

I can't find any way to make the row height auto size.

Any help or examples would be much appreciated!!!

Était-ce utile?

La solution

Try wrapping the cell value into a div with a fixed height using the formatter / cellFormatter function inside your grids layout specification. A formatter function can transform your cell value from "This is the my cell value." to "<div>This is the my cell value.</div>".

Check this out:

http://dojotoolkit.org/reference-guide/1.6/dojox/grid/EnhancedGrid/plugins/CellFormatter.html

Autres conseils

Thanks Lucian! The cause of the issue was the width being set to 0 on one of the columns I was trying to hide.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top