OnGroupFooterRender Event

Description

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

Discussion

Allows you to inject HTML above or below the Group Footer HTML. It is fired before a Group Footer 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.groupFooterHTML

The Group Footer 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.

Injecting HTML Above/Below the Group Footer

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

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

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"