Translate

Donnerstag, 2. November 2017

APEX 5 - Interactive Report - Delete Row feature

In the last post I focussed on Insert and Set value features within the IR.

Now I came across this very straight forward approach on "Delete" ROW... from Farzad.
Thanks so much for your Input!

http://farzadsoltani.com/2017/03/14/checkboxes-interactive-reports-ajax-apex/

Crossposting - sorry - but in short:

Farzard makes use of the  APEX_ITEM.CHECKBOX2

Code:

select 
  CHECKBOX_TABLE.SRL as SRL, 
  CHECKBOX_TABLE.NAME as NAME, 
  APEX_ITEM.CHECKBOX2(p_idx => 1, 
                  p_value => SRL, 
                  p_attributes => 'class="boxes"') AS SELECTOR 
from CHECKBOX_TABLE

Then he creates a pl/sql Process like:

BEGIN 
 FOR I IN 1..APEX_APPLICATION.G_F01.COUNT 
 LOOP DELETE CHECKBOX_TABLE 
 WHERE SRL = APEX_APPLICATION.G_F01(I); 
 END LOOP; 
 htp.p('{ "message": "' || APEX_APPLICATION.G_F01.COUNT || ' rows deleted" }'); 
END;

Thirdly he adds a AJAX Callback... - pls see his posting above.
Sorry for x-posting, but I found this as a need solution and completes the added IR features.

Bernhard


Keine Kommentare:

Kommentar veröffentlichen