解决方法:
formatter: function(value,row,index){
var edit='';
if(row.files){
edit+= '<a href="javascript:void(0)" onclick="showFiles(\''+encodeURI(row.files)+'\')">在线填报</a>'
}
return edit;
}
function showFiles(filesStr){
var params = decodeURI(filesStr);
var files= JSON.parse(params);
}
或者直接通过JSON.stringify(object)将对象转为字符串,然后在方法中通过JSON.parse(jsonStr)再将字符串转为对象。