Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>After SEVERAL HOURS of try/catch I finally came with this working example, its working on AJAX POST with new rows appends to the TABLE on the fly (that was my real problem): </p> <p>Tha magic came with link this:</p> <pre><code>&lt;a href="#" onclick="removecompany(this);return false;" id="remove_13"&gt;remove&lt;/a&gt; &lt;a href="#" onclick="removecompany(this);return false;" id="remove_14"&gt;remove&lt;/a&gt; &lt;a href="#" onclick="removecompany(this);return false;" id="remove_15"&gt;remove&lt;/a&gt; </code></pre> <p>This is the final working with AJAX POST and Jquery Dialog: </p> <pre><code> &lt;script type= "text/javascript"&gt;/*&lt;![CDATA[*/ var $k = jQuery.noConflict(); //this is for NO-CONFLICT with scriptaculous function removecompany(link){ companyid = link.id.replace('remove_', ''); $k("#removedialog").dialog({ bgiframe: true, resizable: false, height:140, autoOpen:false, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Are you sure ?': function() { $k(this).dialog('close'); alert(companyid); $k.ajax({ type: "post", url: "../ra/removecompany.php", dataType: "json", data: { 'companyid' : companyid }, success: function(data) { //alert(data); if(data.success) { //alert('success'); $k('#companynew'+companyid).remove(); } } }); // End ajax method }, Cancel: function() { $k(this).dialog('close'); } } }); $k("#removedialog").dialog('open'); //return false; } /*]]&gt;*/&lt;/script&gt; &lt;div id="removedialog" title="Remove a Company?"&gt; &lt;p&gt;&lt;span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"&gt;&lt;/span&gt; This company will be permanently deleted and cannot be recovered. Are you sure?&lt;/p&gt; &lt;/div&gt; </code></pre>
 

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