在手动操作表动态列中仅显示一行文本,后跟 ..



在我的手座表中,我只想在一行中显示文本,之后应该有...,如果有更多的文本。

$scope.textRenderer = function (instance, td, row, col, prop, value, cellProperties) {
if (cellProperties) {

var template;
template = ['<span style="white-space:nowrap; overflow:hidden;text-overflow: ellipsis;">' + value + '</span>'].join('');
while (td.firstChild) {
td.removeChild(td.firstChild);
}
if (!td.firstChild) {
td.appendChild($compile(template)($scope)[0]);
}
}
return td;
};

我已经尝试了上面的代码,但没有显示省略号。

您尝试执行的操作不适用于inline元素。

为您的跨度标记提供display:block;

最新更新