abbreviate long text fields
abbreviate long text fields
hello,
is it possible to abbreviate long text fields ?
for example, display
[code]long t...[/code]
instead of
[code]long text field long text field long text field long text field long text field long text field long text field long text field[/code]
is it possible to abbreviate long text fields ?
for example, display
[code]long t...[/code]
instead of
[code]long text field long text field long text field long text field long text field long text field long text field long text field[/code]
This discussion has been closed.
Replies
http://www.jeremymartin.name/projects.php?project=jTruncate
You can use it in datatables by adding the following options to the initialization (im building these as if it is the only column, please adjust it for your needs):
[code]
"aoColumns" : [
{
mData: null,
sClass: "longTextClass"
}
],
"fnDrawCallback": function( oSettings ){
$('.longTextClass').jTruncate();
}
[/code]
Putting it in the fnDrawCallback will allow it to update every time the table is re-drawn (which is when it needs to be run).
See: http://www.css3.info/preview/text-overflow/
Although this might be a problem in tables, it's worth the look anyway :)