Add Delete icon with JavaScript in Oracle Apex

To add a delete icon with JavaScript in Oracle Apex, you can follow these steps:

  1. Create a new column in your report for the delete icon. Set the column

    type to "HTML Expression" or "Display Only" as per your requirement.

  2. In the column attributes, add the following HTML code for the delete icon:

Here, we are using the Font Awesome library to display the delete icon. You can replace "fa-trash" with any other icon name from the library.

  1. Add a JavaScript function to handle the click event of the delete icon. This function will prompt the user to confirm the deletion and then submit the page to delete the row.

In this function, "DELETE_ROW" is the name of the page process that will handle the row deletion. You can replace it with the actual name of your page process. "P1_ROW_ID" is the name of the item that will hold the ID of the row to be deleted. You can replace it with the actual name of your item.

  1. In the column attributes, set the HTML expression for the delete icon column as follows: Here, "ID_COLUMN" is the name of the column that contains the ID of the

row to be deleted. You can replace it with the actual name of your column.

  1. Save and run your report. You should now se a delete icon in each row of the report. When the user clicks on the icon, the JavaScript function will be called and the row will be deleted if the user confirms the deletion.

Post a Comment

Previous Post Next Post