1

I have the following table with checkbox in my page:

Region type: Interactive grid Checkbox generated by row selector

ColumnA ColumnB ColumnC
1 Hello 123
2 Position 1234
3 Accept 567
4 Position 778
5 Accept 321

I have created buttons such that if the user selects "Position" the row that contains Position checkbox should be selected. If the user selects "Accept" from the button then all row checkbox should be selected. How do I do that?

Sample output: If Position is selected from the menu

Checkbox ColumnA ColumnB ColumnC
1 Hello 123
X 2 Position 1234
3 Accept 567
X 4 Position 778
5 Accept 321

What I tried so far?

apex.region("pos").widget().interactiveGrid("getViews", "grid").view$.grid("selectAll");
apex.message.showPageSuccess( "All Rows selected successfully." );}

The above script selects all the checkbox and not a particular checkbox like I want.

  • Can you provide some more info ? What is the region type for your table (classic report, interactive report, interactive grid) ? How are you generating the checkbox (apex_item.checkbox, native in IG) ? – Koen Lostrie Mar 09 '23 at 10:52
  • The region type is interactive grid and the checkbox was generated using APEX$ROW_SELECTOR – Itsme mylife Mar 09 '23 at 11:08
  • Writing customized javascript for interactive grids is a lot of work, I suggest you check out the interactive grid cookbook (google "ig cookbook") and browse through the forums to see if you can find anything that you an re-use. I doubt (but could be wrong) that anyone is going to take the time to write your solution for you. – Koen Lostrie Mar 09 '23 at 11:59

1 Answers1

0

How about workaround?

  • alter table and add checkbox column to it, let's call it cb_column

  • if that "menu" you mentioned contains 2 options: position and accept, create two buttons instead

  • each button submits and fires its process, a PL/SQL procedure which updates underlying IG table

  • you know which query you used to present data in the IG - reuse it in update, e.g. for the position button:

    update that_table set
      cb_column = 1
      where column_B = 'Position'
        exists (select null
                    from <your IG query comes here]
               )
    
  • because of submit, page will refresh and display new data in the IG

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
  • That's that helped. I did a work around and created a JavaScript, But, this extracts all the rows and not Positions/Accept. Do you have any solution for this? ```apex.region("pos").widget().interactiveGrid("getViews", "grid").view$.grid("selectAll"); apex.message.showPageSuccess( "All Rows selected successfully." );``` – Itsme mylife Mar 09 '23 at 16:01