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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Javascript Help for Disabling Row Selector on Interactive Grid

Joe RJul 29 2020 — edited Jul 30 2020

Version: Application Express 19.2.0.00.18

Hello,

A co-worker just asked me for help with disabling the Row Selector on an Interactive Grid based on a condition.

He currently has a function in the "Function and Global Variable Declaration" section to disable the Row Selector when the report loads, scrolls, or changes to another saved report.

The problem is when sorting one of the columns. The function doesn't seem to be executed.

Here's the Function:

function disableRowSelector() {

    var records = $(".a-GV").first().find( ".a-GV-w-scroll .a-GV-row" );

    var eclipseUser = $("#P21_ECLIPSE_ID")[0].value;

    var userSSO = $("#P21_SSO_ID")[0].value;

   

    for(var i = 0; i < records.length; i++){

        var compareText = records.eq(i)[0].cells[4].innerText;

        var compareID = records.eq(i)[0].cells[5].innerText;

      

        //console.log("compareText: " + compareText);

        if (compareText === 'HOUSE' && compareID !== eclipseUser && compareID !== '-'){

            var dataId = records.eq(i).attr("data-id");

           

            // Remove Checkbox from that row

            $(".a-GV").first().find( ".a-GV-w-frozen .a-GV-row[data-id='" + dataId + "'] .u-selector").removeClass();

        }

        else if((eclipseUser === compareText || compareText === 'HOUSE' || compareText === '-') && compareText){

             var dataId2 = records.eq(i).attr("data-id");

           // $(".a-GV").first().find( ".a-GV-w-scroll .a-GV-row[data-id='" + dataId2 + "']").css("background-color", "#00FF00");

        }

        else{

           

            // Get data-id of row where Eclipse User does not match Inside Sales Person

             var dataId = records.eq(i).attr("data-id");

           

            // Remove Checkbox from that row

            $(".a-GV").first().find( ".a-GV-w-frozen .a-GV-row[data-id='" + dataId + "'] .u-selector").removeClass();

        }

    }

}

Line 27 is where he's disabling the Row Selector.

So again the issue is that this function doesn't seem to run when column sorting is applied on the report.

Can someone help with this?

Thanks,

Joe

This post has been answered by Keyser on Jul 30 2020
Jump to Answer

Comments

Post Details

Added on Jul 29 2020
9 comments
2,901 views