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

Posted on 2017-12-26 09:33  zkx4213  阅读(291)  评论(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;
}

Copyright © 2024 zkx4213
Powered by .NET 8.0 on Kubernetes