Uncaught TypeError: Cannot read property 'replace' of null
formatter : function(value,v,row) {
var res = ' ';
var str='sdfhsdf';
debugger;
if(trim(row.disabled) == '1'){
res = '<input rule="monthlyItems_deductionReason" readonly name="deductionReason_'
+ index + '" class="widthInputLonger" maxlength="200" type="text" value="'
+ (value || "") + '" />';
}else{
str=(row.factorDetail).replace(";","。");;
//alert(str);
res ='<div style="position:relative;"><span style="margin-left:100px;width:19px;overflow:hidden;"> '
+'<select style="width:100%;margin-left:-100px" onchange="this.parentNode.nextSibling.value=this.value"> '
+'<option value="天蓝蓝">天蓝蓝</option><option value="'+str+'">'+str+'</option>'
+'</select></span><input rule="monthlyItems_deductionReason" name="deductionReason_'
+ index + '" class="widthInputLonger" id="deductionReasonInput" maxlength="200" type="text" style="width:88%;position:absolute;left:0px;" value="'
+ (value || "") + '" /></div>';
}
return res;
},
红色部分在运行,使用alert的时候可以弹出,但是会出现如下错误:
Uncaught TypeError: Cannot read property 'replace' of null
at HTMLTableElement.formatter (input.do?id=1F366563E85B47DD9E5B802BEE4DDAFE:162)
at x (jquery.jqGrid.min.js:50)
at G (jquery.jqGrid.min.js:50)
at Y (jquery.jqGrid.min.js:66)
at Object.success (jquery.jqGrid.min.js:81)
at fire (jquery-1.11.1.js:3119)
at Object.fireWith [as resolveWith] (jquery-1.11.1.js:3231)
at done (jquery-1.11.1.js:9275)
at XMLHttpRequest.callback (jquery-1.11.1.js:9685)
在线等,这是什么原因,该如何解决