0

I have a ContentPane whose contents property is set to a bunch of text (no additional widgets). I want to be able to truncate the text after, say, 3 lines and append a "read more" link that will expand the ContentPane vertically to display the rest of the contents.

Here is what I have:

<div data-dojo-type="dijit/layout/ContentPane" 
     data-dojo-attach-point="truncateMe" 
     data-dojo-props="content: 'Way more than three lines of text'">
</div>

Is there a way to set the max number of rows in a ContentPane and truncate the text accordingly with an option to expand the pane?

Thanks!

Bucket
  • 7,415
  • 9
  • 35
  • 45
  • I think it needs to be after n characters - lines can only be determined AFTER the copy has been rendered in the browser when formatting & layout have been accounted for. – Diodeus - James MacFarlane Mar 21 '13 at 15:20
  • Drat. Guess I'll have to go back to plain ol' JS. At least there's this, which I just found: [link](http://stackoverflow.com/questions/783899/how-can-i-count-text-lines-inside-an-dom-element-can-i). – Bucket Mar 21 '13 at 15:36

0 Answers0