Checkbox in Interactive Report and Delete multiple Selective rows

 

If you want to delete multiple rows single click. Then you following the steps....

Step-1 : Create Blank Region 

--> Type : Interactive Report

--> SQL Query : Use the following code 

SELECT 
        apex_item.hidden(01,EMPLOYEE_ID)||
        apex_item.checkbox2(02,EMPLOYEE_ID) check1, 

        EMPLOYEE_ID, FULLNAME,DEPARTMENT_ID,
        PHONE1,IMAGE,PERMANENT_ADDRESS
from   EMPLOYEES  

Note: checkbox2(02,EMPLOYEE_ID) = Checkbox name হবে name=f02
(যদি checkbox2(01,EMPLOYEE_ID) à¦¦াও, তাহলে f01 à¦¹à¦¬ে — সেক্ষেত্রে PLSQL কোডে name="f01" দিতে হবে।)


---> Select the "CHECK1" Column and Use the following code in the "heading"

  <input type="checkbox" id="selectUnselectAll" title="Select/UnselectAll">

--> Disable the "Escape special characters" option from the "Security option"

    of the "CHECK1" item

--> Enable Users To : Unselect All

Step-2 : Select this Interactive Report

-->  Static ID: partnerslRR   

Step-3 : Create Dynamic Action 

--> Name : Select All
--> Events : Change
--> Selection Type : jQuery Selector 
--> jQuery Selector : #selectUnselectAll
--> Action: Execute JavaScript Code:

            if ( $( '#selectUnselectAll' ).is(':checked') ) {
                  $('input[type=checkbox][name=f02]').attr('checked',true);
                        }
                  else {
                  $('input[type=checkbox][name=f02]').attr('checked',false);   

                        }

Step-4 :  

--> Create a Delete Button 
Dynamic Action on  Delete Button  : Execute javascript code:

        apex.confirm("Are you sure  want to Delete?","Delete");

Step-5 : 

--> Create a Delete Processes
--> Type : Execute Code 
--> Source Language : PL/SQL Code :

        FOR I in 1..APEX_APPLICATION.G_F02.COUNT LOOP
            DELETE EMPLOYEES
            WHERE EMPLOYEE_ID=APEX_APPLICATION.G_F02(i);
            END LOOP;

When Button Pressed : Delete


=========================================

বিকল্প 

=========================================

Step-1 : 
SQL Query:


Select  . . .
      APEX_ITEM.CHECKBOX2(P_IDX => 1,
                                   P_VALUE => MA_LINE_ID,
                                   P_ATTRIBUTES =>  'CLASS="BOXES"')
    END AS ACTION
FROM TABLE_NAME;

Note: ðŸ‘‰ তাহলে checkbox name হবে name=f01
(যদি P_IDX => 2 দাও, তাহলে f02 হবে — সেক্ষেত্রে কোডে name="f02" দিতে হবে।)

Step-2 : 

Select ACTION column.
Heading: 
<input type="checkbox" id="checkAll" title="Select All">
Execute when Page Loads:

/* --- Action All CheckBox ----*/
(function($){
  // Function to bind click event for header checkbox
  function bindCheckAll(){
    // Prevent duplicate binding
    $('#details_item_ir').off('click', '#checkAll'); //IR report Satic ID
    
    // When header checkbox clicked
    $('#details_item_ir').on('click', '#checkAll', function(){
      var checked = $(this).is(':checked');
      // Target all row checkboxes generated by APEX_ITEM
      $('#details_item_ir input[type=checkbox][name="f01"]').prop('checked', checked);
    });
  }

  // Initial bind when page loads
  bindCheckAll();

  // Re-bind every time Interactive Report refreshes
  $(document).on('apexafterrefresh', '#details_item_ir', function(){
    bindCheckAll();
  });

})(apex.jQuery);



Post a Comment

Previous Post Next Post