Published On Sep 25, 2024
This video is about how to add add checkbox in card region. How to check and uncheck the checkboxes in the cards when I click the check all checkbox. How to create, edit and delete the selected cards in Oracle APEX.
go to the page item checkbox, create dynamic action:
Event: Click
Selection Type: Items
Items: P34_SELECTUNSELECTALL
Action:
if ($('#MyCard #P34_SELECTUNSELECTALL' ).is(':checked') ) {
$('#MyCard input[type=checkbox][name=f01]').prop('checked',true);
} else {
$('#MyCard input[type=checkbox][name=f01]').prop('checked',false);
}
/*****************when deselect card checkbox then unselect all ********************/
$('#MyCard input[type=checkbox][name=f01]').click(function(){
var numberOfCheckboxes = $('#MyCard input[type=checkbox][name=f01]').length;
var numberOfCheckboxesChecked = $('#MyCard input[type=checkbox][name=f01]:checked').length;
if(numberOfCheckboxes == numberOfCheckboxesChecked) {
$('#MyCard #P34_SELECTUNSELECTALL').prop('checked', true);
} else {
$('#MyCard #P34_SELECTUNSELECTALL').prop('checked', false);
}
});
Process for delete:
PL/SQL:
BEGIN
FOR x IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
delete from emp where empno=APEX_APPLICATION.G_F01(x);
END LOOP;
END;