Displaying of a select list and a button based on conditions in one Tabular Form Column

Introduction

This post details the steps required to display a select list and a button based on condition in tabular form.

 

Problem statement

 For already existing records in data base a select list must display, and for newly added records a button must display for deleting the newly added record

Steps to Follow

Create a dynamic action on clicking of add_row button as

  var $tr = $(“TABLE[summary=’Form on Vehicle Parts’]>tbody tr:last”);

if (parseInt($(“#P5_VEHICLE_TYPE”).val(), 10) == 0) {

alert(“Please select any one of the Vehicle Type from the list.”);

$(“#P5_VEHICLE_TYPE”).focus();

}

else {

apex.widget.tabular.addRow(); // Adds NewRow

 

$tr = $(“TABLE[summary=’Form on Vehicle Parts’]>tbody tr:last”);

$(“td[headers=’ACTIVE_STATUS’] SELECT”, $tr).css({display: “none”});

$(“td[headers=’ACTIVE_STATUS’]”, $tr).append(‘<button class=”uButton” onclick=”$(this).closest(\’tr\’).remove();” type=”button”><span>Delete</span></button>’);

}

It includes region name in summary

 

Call To Action:        

For Oracle apex development and customization please do visit our company website https://doyensys.com/

 

Conclusion

Using above code we can perform condition based select list and button in tabular form.

Recent Posts