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!

Issue with the Uncheck Checkbox in Interactive Grid

Uday S. NadellaJul 23 2024 — edited Jul 25 2024

I have created a checkbox column in Interactive Grid and when the checkbox is un-checked for any of the row the current record Bill Percent and Amounts should be null. I have coded the logic in the Function and Variable declaration. But the issue is that i have to uncheck the row checkbox and mouse-click outside the grid to make the Bill Percent/Amount null otherwise when i just uncheck the checkbox, the values stay as below: Please help to resolve this.

Logic:

$(function() {     
   // the model gets released and created at various times such as when the report changes  
   // listen for model created events so that we can subscribe to model notifications              
   $("#Project\_Tasks\_IG").on("interactivegridviewmodelcreate", function(event, ui) {  
       var sid,  
           model = ui.model;

       if ( ui.viewId === "grid" ) {  
           sid = model.subscribe( {   
               onChange: function(type, change) {

                   if  (type === "set" &&  change.field == "INCLUDE\_TASK" ) {                              
                                                       update2( model);                               
                           
                       }

….

….

function update2(model) {
var model = apex.region("Project_Tasks_IG").widget().interactiveGrid("getViews","grid").model;
var selrec = model.getSelectedRecords();
var currec = model.getValue(selrec, "INCLUDE_TASK");

   if (currec != undefined) {   
           if (model.getValue(currec, "INCLUDE\_TASK") == 'N'){  
                        model.setValue(currec,'BILL\_AMOUNT','');  
                        model.setValue(currec,'BILL\_PERCENT','');                                                       

           }       
    }

}

Comments
Post Details
Added on Jul 23 2024
4 comments
277 views