我的json就像:
"ModelNo":"TEST 5","Weight":5,"ExportLevel":"Req'd","SafetyType":"UNDETERMINED"
var jsonString = JSON.stringify(rowObject);
我尝试过以下代码,但没有帮助:
jsonString.replace("'", "\\'");
我认为这个单引号是个问题。请帮忙。怎么逃避这个?
我的代码:
me.getHyperlinkColumn = function (cellvalue, options, rowObject) {
//var jsonString = JSON.parse(rowObject);
hyperLink = "<a href='#' id='hplinkactionUrl_" + options.rowId + "' onclick='" + options.colModel.CallMethod + "(" + options.rowId + "," + JSON.stringify(options) + "," + JSON.stringify(rowObject) + ")' style='text-decoration:underline; color:#3361b8;'>" + cellvalue + "</a>"
return hyperLink;
}