|
|
@ -45,33 +45,31 @@
|
|
|
|
* } );
|
|
|
|
* } );
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
jQuery.fn.dataTable.render = {
|
|
|
|
jQuery.fn.dataTable.render.ellipsis = function ( cutoff, wordbreak ) {
|
|
|
|
ellipsis: function ( cutoff, wordbreak ) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
display: function ( d ) {
|
|
|
|
display: function ( d ) {
|
|
|
|
if ( wordbreak === undefined ) {
|
|
|
|
if ( wordbreak === undefined ) {
|
|
|
|
wordbreak = false;
|
|
|
|
wordbreak = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( typeof d !== 'number' && typeof d !== 'string' ) {
|
|
|
|
|
|
|
|
return d;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var str = d.toString(); // cast numbers
|
|
|
|
if ( typeof d !== 'number' && typeof d !== 'string' ) {
|
|
|
|
|
|
|
|
return d;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( d.length < cutoff ) {
|
|
|
|
var str = d.toString(); // cast numbers
|
|
|
|
return d;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str = d.substr(0, cutoff);
|
|
|
|
if ( d.length < cutoff ) {
|
|
|
|
|
|
|
|
return d;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( wordbreak ) {
|
|
|
|
str = d.substr(0, cutoff);
|
|
|
|
// Find the last white space character in the string
|
|
|
|
|
|
|
|
str = str.replace(/\s([^\s]*)$/, '');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return '<span class="ellipsis" title="'+d+'">'+str+'…</span>';
|
|
|
|
if ( wordbreak ) {
|
|
|
|
|
|
|
|
// Find the last white space character in the string
|
|
|
|
|
|
|
|
str = str.replace(/\s([^\s]*)$/, '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
return '<span class="ellipsis" title="'+d+'">'+str+'…</span>';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|