Forum Stats

  • 3,767,857 Users
  • 2,252,726 Discussions
  • 7,874,366 Comments

Discussions

How to get Data from a selected row

User_6L3S5
User_6L3S5 Member Posts: 13 Green Ribbon

Hello APEX-Community,

I'm using a row selection (single selection only) in an interactive grid and a modul dialog to work with the selected data in more detail. What i want to do is use the data from the selected row, f.e. the data from the column "Employe_Id" of the selected row. How do i get the data, to pass it to the modul dialog/ use it in PL/SQL-Statements etc. I thought there may be a statement sth like "apex.selectedRow.getFirstColumn"?

Thanks for the help

Jakob

Tagged:

Answers

  • Pierre Yotti
    Pierre Yotti Member Posts: 4,040 Bronze Crown

    Hallo Jakob,


    • you can add this function in function and global variable declaration

    var getValue = function(pStaticID, pCol, pItem) {

      var widget = apex.region(pStaticID).widget();

      var grid = widget.interactiveGrid('getViews', 'grid');

      var model = grid.model;

      var record = model.getRecord(this.data.selectedRecords[0][0])

      apex.item(pItem).setValue(model.getValue(record, pCol))

    }

    • Create a dynamic action on selection change for the IG with Execute Javascript Code

    getSelectedVal('emp', 'EMPNO', 'P1_ITEM', this)


    Pierre