Monday, 11 August 2025

Selective Columns in Intrective Report in Apex

Give each column a ststic ID / IR Region Static ID (wtr in my Case) 

Add a Page Item and  Set its Property as Shuttle and Give static values ( as per Columns Id's )


Execute Java Script Code on Change Event


/*****************************************************************/

var selectedCols = $v('P1075_COL_SELECTION').split(':').map(s => s.trim());


var allCols = [

    'IGP_DATE',

    'IGP_NO',

    'ACNAME',

    'PO_NO',

    'ITEM_NAME',

    'KANTA_SLIP_NO',

    'BAGS',

    'BUILTY',

    'VEHICLE',

    'CHALAN',

    'FIRST_WEIGHT',

    'TARE_WEIGHT',

    'GROSS_WEIGHT',

    'LAB_DEDUCTION',

    'IN_TAKE_DEDUCTION',

    'NET_WEIGHT',

    'WEIGHT_HOUSE',

    'TOKEN_NO'

];


// Add dynamic headers

$("#wtr th").each(function() {

    var colId = $(this).attr("id");

    if (colId && !allCols.includes(colId)) {

        allCols.push(colId.trim());

    }

});


// Show/hide columns based on selection

allCols.forEach(function(colId) {

    var showCol = selectedCols.includes(colId);


    // Toggle headers

    $("#wtr th[id='" + colId + "']").toggle(showCol);


    // Toggle data cells using headers attribute

    $("#wtr td[headers='" + colId + "']").toggle(showCol);

});


// Debug: log headers

console.log('Headers in table:');

$("#wtr th").each(function() {

    console.log($(this).attr('id'));  // changed from .attr('headers') to .attr('id')

});


/*****************************************************************/

Create a Dynamic Action After Refresh Region Event 

and Execute Java Script Code Again ( from Above)


No comments:

Post a Comment

Check Internet Connectivity on Local System

if (!navigator.onLine) {     showOfflineAlert(); } else {     // Set a strict 3-second network timeout threshold     const controller = new ...