How to store the selected Rows Column value into Array in Interactive Grid

 How to store the selected Rows Column value into Array in Interactive Grid  

In Oracle Forms we performed the following coding 

/*GO_BLOCK ('TEST');
First_record ;
While system.last_Record <> true  loop
    if :test.status ='Y' then 
    :Master.Nbt_Sel :=:Master. Nbt_Sel + :test.docno ;
    end if;
next_Record;
end loop;*/

How to achieve in Oracle APEX Interactive GRID

Create Download button grid --> DA--Java Script 

function Download() 
  {
  var widget = apex.region("POR01").widget();
  var grid = widget.interactiveGrid("getCurrentView");
  var model = grid.model;
  var selectedRecords = grid.getSelectedRecords(); 
  var selRecords = {
  "rows": []
  };
  var selRecordsJSON;    
  if (selectedRecords.length > 0) 
      {
         if (confirm("Do you want to update commission for selected Document? Please confirm.")) 
            { 
               
                 
                for (idx=0; idx < selectedRecords.length; idx++)
      
                {
                     record = selectedRecords[idx];
                         console.log("Selected ",selectedRecords.length);
                         i_docno=model.getValue(record,"DOCNO");
                        selRecords.rows.push({"i_docno": i_docno});
                }       
                 
             }
                      selRecordsJSON = JSON.stringify(selRecords);
                      console.log(selRecordsJSON);
                      apex.page.submit({request: "GetPoRecord",set: {"P6041_NBT_SEL": selRecordsJSON},showWait: true});
      
      }
     else {apex.message.alert("Atleast One Document Has To Be Selected");}  
      
  }
      
  function GetPoRecord ()
  {
   console.log('');   
  }

Comments

Popular posts from this blog

Telegram Integration with Oracle

The username or password for the connection pool named |apex||, are invalid, expired, or the account is locked

Enabled SQL Developer Web (SDW) & ORDS Database API ORDS 19.4