1、将行变成超连接如下所示

name: "CurrentScore", index: "CurrentScore", width: 80, align: "center", formatter: 
                            function (cellValue, options, rowdata, action) {
                                return "<a href='#' onclick=" + "ScoreDetail('" + rowdata.PassportNumber + "')" + ">考核详情</a>";
                               
                            }

2、解析成的超连接如下所示

jqGrid  将行变成超连接时浏览器解析超连接错误
3、问题原因
    通过排查问题,发现是传入的参数 rowdata.PassportNumber 带有空格,在生成超连接的时候被当成了换行符,而js在拼字符串的时候,如果换行了之后是会被截断的,就生成了上面的超连接。
4、解决问题
    找到问题原因后解决问题就简单了,去掉参数后面的空格就行了
function Trim(str) {
                return str.replace(/(^\s*)|(\s*$)/g, "");
            }

 

  

相关文章:

  • 2021-11-06
  • 2021-05-29
  • 2022-12-23
  • 2022-02-14
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-09-29
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案