Skip to content

Select All / Unselect All Checkbox in Interactive Report Header

November 15, 2012
I want a checkbox in an Interactive Report (IR), and I want the users to be able to quickly Select All or Unselect All of them. I don’t want two big clunky buttons to do this, I just want a single checkbox in the header like I see on cool peoples’ web sites.
To do this:
1. In the Region Definition for the IR, add the checkbox to the query, e.g.:
SELECT ...,
       apex_item.checkbox(1, record_id) selected
FROM   ...
2. In the Report Attributes for the IR, modify the attributes of column “SELECTED”:
Heading = <input type="checkbox" id="selectunselectall">
Display Text As = Standard Report Column
Allow Users To = (uncheck all options, including Hide, Sort, etc.)
3. In the page definition, add a Dynamic Action:
Event = Change
Selection Type = jQuery Selector
jQuery Selector = #selectunselectall
Condition = - No Condition -
True Action = Execute JavaScript Code
Fire On Page Load = (uncheck)
Code =
if ( $( '#selectunselectall' ).is(':checked') ) {
  $('input[type=checkbox][name=f01]').attr('checked',true);
}
else {
  $('input[type=checkbox][name=f01]').attr('checked',false);
}

The only issue with this is if the user clicks “Action” and “Select Columns”, the checkbox item shows the html code (“<input type=”checkbox”…”) instead of a nice name. I think I’ll be able to get away with this.

About these ads

From → APEX

One Comment
  1. Reblogged this on Sutoprise Avenue, A SutoCom Source and commented:
    Add your thoughts here… (optional)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 113 other followers

%d bloggers like this: