16. js方法传多个参数的实例

field : 'operate',
width : fixWidth(1/6),
title : '操作',
align : 'center',
formatter : function(id,rowData, index) {
  var jsonObj = {};
  jsonObj.test1 = "test1";
  jsonObj.test2 = "test2";
  jsonObj.test3 = "test3";
  opStr = '<a href="javascript:void(0)" color="red" onclick="testLink('+JSON.stringify(jsonObj).replace(/"/g, '&quot;')+')">测试</a>';
  return opStr;
}

function testLink(obj) {
  var test1 = obj.test1;
       var test2 = obj.test2;
       var test3 = obj.test3;
}

原文地址:https://www.cnblogs.com/zkx4213/p/8116440.html