sys_Param.aspx라는 이름의 파일에 내 코드의 첫 번째 조각을, 바인더 제본했다 삭제 botton을 클릭 할 때 내 복제 노드를 삭제할 수 없습니다 :내가 클릭 이벤트
<div id="div_water" style="display: none" align="center">
<table width="100%" border="0" id="printTbl" align="center" cellpadding="5" cellspacing="1" class="table">
<tr class="TR_BG_list" id="printsizescroll" style="display:none">
<td align="right" class="list_link" style="width: 214px">
Resize the pictrue:
</td>
<td align="left" class="list_link">
Description:
<asp:TextBox ID="PrintSizeDec" runat="server" CssClass="form" style="width: 106px"/>
width|height:
<asp:TextBox ID="PrintSmallSize" runat="server" CssClass="form" style="width: 50px"/>
<label>
<input type="button" name="PintSizeAddClick" value="Add" class="form" id="ButtonAdd" style="width: 44px" onclick="createInputTexts(this)" />
</label>
<span class="helpstyle" style="cursor: help;" title="Click to get some help" onclick="Help('H_WaterParam_0008',this)">Help</span>
</td>
</tr>
<tr class="TR_BG_list">
<td align="center" colspan="2" class="list_link">
<label>
<input type="submit" name="Savewater" value=" Submit " class="form" id="Savewater" runat="server" onserverclick="Savewater_ServerClick" />
</label>
<label>
<input type="reset" name="Clearwater" value=" Reset " class="form" id="Clearwater" runat="server" />
</label>
</td>
</tr>
</table>
또 다른 부분 : 이벤트 핸들러 :
function createInputTexts() {
var trOrigin = $("#printsizescroll");
var trClone = trOrigin.clone(true);
var target = $("#printTbl tr:last-child").prev();
trClone.find(":button").val("delete");
$('#printTbl').on('click', 'input[type="button"][value="delete"]', function() {
$(this).parent().parent().parent().remove();
});
trClone.css('display', '');
// Here you can also set new ID.
target.after(trClone);
}
질문입니다 : 내가 삭제 버튼을 클릭하면, 그것은 jQuery를 dynamicly.I에 의해 생성 된 새로운 복제 행을 삭제하지 않는 것은 I 원인, 너무 혼란스러워했다 하아 클릭 이벤트를 모든 삭제 버튼에 바인딩합니다. 도움이 필요합니다. 감사합니다.
[jsfiddle] (http://www.jsfiddle.net)에서 출력 된 마크 업을 사용하여 데모를 만들고 구체적으로 무엇이 작동하지 않습니까? – undefined
제 질문을 훨씬 더 구체적으로하기 위해 몇 가지 단어를 추가하려고합니다. 그게 맞습니까? –
버튼에 대해 onclick 이벤트가 이미 지정되어있어 삭제 버튼이됩니다. 그것으로부터 클릭 이벤트를 언 바인드하고 삭제를 처리 할 새로운 클릭 이벤트를 추가해야합니다. – fenix2222