OnGroupHeaderRender Event


This event fires when a Group Header is rendered. It allows you to inject HTML either before, or after the Group Header HTML, or modify the Group Header HTML computed by Alpha Anywhere. Group Headers are displayed if you turn on the 'Has group breaks' property.


Allows you to inject HTML above or below the Group Header HTML. It is fired before a Group Header is rendered.

The following variables are available to you in the event:


The grid component definition


Run-time calculations (allows you to pass data to other event handlers)


The Group Header HTML computed by Alpha Anywhere


The current value of the Group Break Expression


A pointer to summary values computed for the current group


A pointer to the table (for .dbf) or resultset (for SQL) for the current row in the Grid. IMPORTANT: Your code must NOT advance the pointer (by doing a e.tbl.fetch_next() or e.tbl.nextRow()). You can read values from the current grid row as follows:"feldname").

For SQL Grids the data in e.groupSummary does not use real fieldnames. The data is mapped to psuedo fields like 'GROUP_SUMMARY_FIELD_1', 'GROUP_SUMMARY_FIELD_2', etc. The map from real field name to psuedo field name can be found in the e.rtc.summaryValueFieldMap property.

Your event can optionally set the e.javascript to emit Javascript. Properties your event can set are listed below:


Optional javascript to send to the client

Injecting HTML Above/Below the Group Header

If you inject HTML above or below the Group Header, you must wrap the injected HTML in <tr>..</tr> tags. The example below shows how a row is injected above the Group Header:

e.groupHeaderHTML = "<tr><td colspan=\"100\">New data above the header</td></tr>" + e.groupHeaderHTML

Setting State Variables

You can also set state variables in this event. The value of any state variables will be available in all subsequent ajax callbacks (in the e.__si2 object).

To set a state variable:

e._state.myvar1 = "value1"
e._state.myvar2 = "value2"