1
一旦单元格被徘徊,是否有更高效的方式显示工具提示?使用结构属性格式化数据网格,有没有办法使用格式化程序来显示dijit工具提示,而不是使用html标题属性。使用Dojo DataGrid和JSonRestStore显示dijit工具提示
这里是工具提示显示的列。
var subscriberGridLayout = [
{
name: " ",
field: "ExpirationDate",
formatter: function(value){
if(value){
expDate = formatDateIE(value);
return toolTip();
}
else
return " ";
},
styles: "text-align: center;",
width: "30px"
},
这里是通过图像标签会显示一个提示图标,但不是dijit的工具提示它只是使用HTML的标题显示弹出的功能。
function toolTip(){
src = "'/Subscriber/resources/images/icons/icon_error.gif'/>";
if(dojo.date.difference(today, expDate) <= 0){
message = "Credential expired.";
return "<img title='"+ message + "' src=" + src + "";
} else if(dojo.date.difference(today, expDate) <= 60) {
message = "This Subscriber will expire in " + dojo.date.difference(today, expDate) + " days."
+ " To prevent an interruption in the Subscriber’s access, please sumbit a request to " +
"renew the Subscriber within 30 days of the expiration date.";
return "<img title='"+ message + "' src=" + src + "";
} else {
return " ";
}
}