【发布时间】:2016-05-17 06:36:27
【问题描述】:
我正在尝试为带有图像的表格中的单元格获取包含 2000 个字符的工具提示或标题。尝试使用各种东西,但无法获得任何解决方案。请帮忙。我的专栏代码,
{
name: 'comments',
index: 'comments',
width: 80,
align: 'center',
resizable: true,
sortable: false,
editable: false,
cellattr: function(rowId, val, rawObject) {
return 'title="' + val + '"'
},
formatter: function(cellvalue, options, rowobject) {
if (cellvalue.length <= 0) {
return cellvalue;
} else {
var image = "<img src='/images/comment.png' />";
return image;
}
}
},
第二次代码试用,
{
name: 'comments',
index: 'comments',
width: 80,
align: 'center',
resizable: true,
sortable: false,
editable: false,
formatter: function(cellvalue, options, rowobject) {
if (cellvalue.length <= 0) {
return cellvalue;
} else {
var image = "<img src='/images/comment.png' title='Comments:\n" + cellvalue + "'/>";
return image;
}
}
},
当有 2000 个字符时,上面的代码没有显示任何工具提示。
也试过了,
var image = '<figure><img src='/images/comment.png' title='Comments:\n"+cellvalue+"'/></figure>';
加载工具提示的速度非常慢。 请帮忙。
【问题讨论】:
标签: javascript jqgrid tooltip cell title