In jqGrid, is there a native way to show \"...\" at the end of a column if it\'s text did not fit and was truncated?
I see that there is a ui-ellipsis class but I\'m
fit text plugin:
(function($) {
$.fn.fitText = function(options) {
options = $.extend({
width: 0,
height: 0
}, options);
$(this).each(function() {
var elem = $(this);
if (options.height > 0) {
while (elem.height() > options.height) {
elem.text(elem.text().substring(0, (elem.text().length - 4)) + "...");
}
}
if (options.width > 0) {
while (elem.width() > options.width) {
elem.text(elem.text().substring(0, (elem.text().length - 4)) + "...");
}
}
});
}
})(jQuery);
calling the function:
$('.ADHrefUserName').fitText({ width: 200, height: 25 });