0
我的劍道模板如下:劍道上傳 - 如何添加JavaScript事件處理程序文件刪除按鈕,單擊
<div id="file-err-msg" > Please remove files with errors</div>
<input name="files" id="files" type="file" />
<script id="fileTemplate" type="text/x-kendo-template">
<span class='k-progress'>
</span>
<strong class='k-upload-status'>
<button type='button' class='btn-remove k-button k-button-bare k-upload-action'>
<span class='k-icon k-i-close k-delete' title='Remove'></span>
</button>
</strong>
</script>
<script>
$("#files").kendoUpload({
template: kendo.template($('#fileTemplate').html())
});
</script>
我需要隱藏id爲股利 - 文件 - ERR-味精,當刪除按鈕被點擊。單擊「c-class」類的跨度時,Remove動作就會發生。此外,我還需要添加下面的事件處理程序,並且它永遠不會被調用。
$(".k-delete").click(function() {
alert("Remove button clicked");
});
因爲這些控件是動態呈現的,我試圖將它們綁定到如下的事件處理程序,但沒有任何效果。
$("body").on("click", ".btn-remove", function() {
alert("dynamic control event handler");
});
任何幫助表示讚賞!
相信remove事件僅在上傳widget是異步工作。 – Bochu