Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interactive Grid (IG) - Custom Delete not invoking selection-delete

Kashif KhanAug 18 2020 — edited Aug 18 2020

-=Apex 20.1=-

We have an IG report in which we've set the column APEX$ROW_ACTION to be Hidden. However, we've added a custom Delete button to the IG with custom action to display a confirmation before deleting the records, as shown below. The invocation of selection-delete is not working as expected. When I select few records and click on Delete it prompts me to confirm, when I press OK, it just refresh the IG.

    toolbarGroup.controls.push({type: "BUTTON", action: "cust-del-pwd", label: "Delete", icon: "icon-ig-delete", iconBeforeLabel: true, hot: true});

    config.initActions = function(actions){actions.add({name: "cust-del-pwd", action: function(event) {

                    var records = apex.region("CREDS\_IG").widget().interactiveGrid("getCurrentView").getSelectedRecords();

                    if (records.length > 0) {

                        var r = apex.confirm("Do you want to continue?");  

                        if (r == true) {apex.region("CREDS\_IG").widget().interactiveGrid("getActions").invoke("selection-delete");}

                    }               

            }

          });

        };

Where: CREDS_IG is the static ID of the IG.

pastedImage_5.png

The following works just fine, however, I would like to display a confirmation dialog before deleting the records, hence the custom action.

toolbarGroup.controls.push({type: "BUTTON", action: "selection-delete", label: "Delete", icon: "icon-ig-delete", iconBeforeLabel: true, hot: true});

Any idea what is missing from that code?

Thanks in advance.

Comments
Post Details
Added on Aug 18 2020
1 comment
1,475 views