87,904
社区成员
发帖
与我相关
我的任务
分享
//增加行函数
function addsubject(_this){
var trindex=_this.parentNode.parentNode.rowIndex-1;
var trHTML = ['<tr class="entry_item">',
'<td class="operatesubject" style="border-top-width: 0px; border-right: #ff0000 0px solid; border-left: #ff0000 0px solid;"><input type="button" value="增加" onclick="addsubject(this)" style="width: 30px;height: 25px"/><BR/><input type="button" value="删除" onclick="delsubject(this)" style="width: 30px;height: 25px"/></td>',
'<td class="col_summary" onclick="showSummary(this)"></td>',
'<td class="col_subject" onclick="showSubject(this)">',
'<div>',
'<div style="position:relative;left:0;top:0" class="sp_subject">',
'<textarea cols="33" rows="3" onblur="subjectshowdiv(this)" class="tex_subject"></textarea>',
'</div>',
'<div style="position:relative;left:0;top:0" class="initsubject"></div>',
'</div>',
'</td>',
'<td class="col_debite" id="col_debite">123</td>',
'<td class="col_credit" onclick="showcolCredit(this)"></td>',
'</tr>'].join('');
$("#voucher tr:eq("+trindex+")").append(trHTML);
refreshaut();//添加行后重新刷新科目自动补全插件bigAutocomplete
}
//点击td后修改td的innerHTML这样写赋值时还是出现unknown runtime error
$(document).on('click', '#col_debite', function (e){
var _this=this;
var tx="";
if(_this.innerHTML.length>2){
tx=_this.innerHTML.substring(0,_this.innerHTML.length-2)+"."+_this.innerHTML.substring(_this.innerHTML.length-2,_this.innerHTML.length)
}
try {
if(_this.innerHTML.length<50){
_this.innerHTML="<textarea cols='33' style='width:218px;height:55px;font-size: 20px;font-family: '宋体';' onblur='showmoneydiv(this)' onkeyup='suDebite(this)'>"+tx+"</textarea>";
}
}catch(e){
alert(e.message);
alert(e.description);
alert(e.number);
alert(e.name);
}
_this.childNodes[0].focus();
_this.childNodes[0].select();
})
function showcolDebite(_this){
var tx="test";
try {
if(_this.innerHTML.length<50){
_this.innerHTML="<textarea cols='33' >"+tx+"</textarea>";//此处赋值抛出异常unknown runtime error
}
}catch(e){
alert(e.message);
alert(e.description);
alert(e.number);
alert(e.name);
}
}