Monday, April 25, 2016

Oracle Apex Tabular Form delete new rows without submitting

A very good way from:

http://techxploration.blogspot.com/2013/08/oracle-apex-tabular-form-delete-unsaved.html


1. Put this in the Global Function:


function delete_rows(){
    var need_submit = 0;
    $("[name='f01']").each(function(){
    if($(this).attr("checked")) {
       if(this.value == 0) // new rows {
           $(this).closest("tr").remove();
       }
       else  {  //existing rows, need to be removed via page submission.
           need_submit = need_submit + 1;  
       }
     });   
     if(need_submit > 0)    // require submission?
        apex.confirm('Are you sure you want to delete it?','DELETE');
        apex.submit('APPLY_CHANGES_MRD'); 
    };

2. in the Button, put "redirect URL" and put this as target:

    javascript:delete_rows();

No comments:

Post a Comment