|
- function appendRow()
- {
- str='<tr>'
- str=str+' <td align="center"><input type="text" name="sQRCode" id="sQRCode"></td>'
- str=str+'<td align="center"><input type="text" name="sName" id="sName"></td>'
- str=str+'<td align="center"><input type="text" name="iQTY" id="iQTY" value="1"></td>'
- str=str+'<td align="center"><input type="hidden" value="" name="iStock_Inid" id="iStock_Inid">增加 <span onClick="deleteRow(this);">删除</span></td>'
- str=str+'</tr>';
-
- $('.gridtable').last().append(str);
-
- }
- function deleteRow(obj) {
- console.log(obj);
- obj.closest("tr").remove();
-
-
- }
- //动态更新click
- $(document).on("change",'[name^="sQRCode"]', function(){
-
- const tr = $(this).parent().parent();
- var objSname=tr.find("input").eq(1)
-
- {
-
- var json= data.data[0]
- objSname.val(json.sName);
- objiStock_Inid.val(json.iStock_Inid);
- objiQTY.attr('onblur','if(this.value>'+json.iAmount+'){alert("不能大于'+json.iAmount+'!");this.value='+json.iAmount+';this.focus();}');
复制代码 |
|