Note that there are some explanatory texts on larger screens.

plurals
  1. POconfirm box more than one time appears
    primarykey
    data
    text
    <p>I am using ajax using jquery, I am deleting a row using the following code snippet:</p> <pre><code>$('#example a.delete'). live('click', function (e) { e.preventDefault(); if (confirm("Are you sure you want to delete this row?")) { alert("Hello World!") } }); </code></pre> <p>When I click <strong>grid view show button</strong>, grid view appears without page refreshing due to ajax. If I click <strong>grid view show button</strong> more than one time, it refresh again grid view area, accordingly. But confirm box show more than one time,which is equal to my no. of clicks on <strong>grid-view show button</strong>, when I click on a single row delete button.</p> <p>How can avoid this !</p> <p><strong>Edited</strong></p> <p>HTML CODE:</p> <pre><code>&lt;td&gt;&lt;a class="delete" href="#" style="margin-left: 10px"&gt;&lt;img src="images/delete-icon.png" width="16px" height="16px" /&gt;&lt;/a&gt;&lt;/td&gt; </code></pre> <p><strong>Edited</strong></p> <p>Complete Code Snippet:</p> <pre><code>$('#example a.delete'). live('click', function (e) { e.preventDefault(); if (confirm("Are you sure you want to delete this row?")) { $getCode = $(this).parent().parent().attr('id'); var oTable = $('#example').dataTable(); var index =oTable.fnGetPosition( document.getElementById($getCode) ); $.post("DeleteDepartment", { depID:$getCode }, function(data) { if(data.result &gt;0){ var oTable = $('#example').dataTable(); oTable.fnDeleteRow( index ); }else{ alert("Operation Fail"); } }); } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload