Adjusting Interactive Report column headings


I have found a few situations where I've needed to add markup to the column heading of a tabular form. For instance if you added an apex_item.checkbox to an interactive report, it would be nice to add a multi-check checkbox to the column heading. The usual way to do this would be to add the following code to the column heading:

<input type="checkbox" onclick="$f_CheckFirstColumn(this)">

There are two issues with this approach. Firstly it can conflict with some of the "Out of the box" functionality you get with IR headings, such as sort, filter, hide etc. Secondly the full escaped markup appears in the 'Select Columns' in the actions menu of the IR. A better approach is to use JQuery to add the code to the column heading. The following code adds a multi-check checkbox to a column called BIN.

Create an Advanced Dynamic Action

Event: After Refresh
Selection Type: Region
Region: [your region]
Event: Scope: Bind
Action: Execute JS Code
Fire when result is: True
Fire on page load: Checked

Code:

$("#BIN").html($("#BIN").html()+'<input type="checkbox" onclick="$f_CheckFirstColumn(this)">');

Make sure that the IR has a region template :)

Comments

Anonymous said…
Thank you. I was able to add a label to first generic column which could not edit by default or is system generated in Interactive Report.