OnGroupHeaderRender Event

Description

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.

Discussion

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:

Variable
Description
e.tmpl

The grid component definition

e.rtc

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

e.groupHeaderHTML

The Group Header HTML computed by Alpha Anywhere

e.breakValue

The current value of the Group Break Expression

e.groupSummary

A pointer to summary values computed for the current group

e.tbl

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: e.tbl.data("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:

Property
Description
e.javascript

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"