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

Posted on 2017-12-26 09:33  zkx4213  阅读(299)  评论(0)    收藏  举报

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;
}

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3