afterServerSideSummaryCompute Event

Arguments

summaryobject

An object that contains the summary values for all fields for which summary values were calculated. Summary values for each field can be referenced using array notation. For example, summary['QTY'].total. Each field in the summary object has the following properties:

Fields in summary are always referenced using uppercase.
totalnumber

The total computed for the field.

countnumber

The count computed for the field.

avgnumber

The average computed for the field.

minnumber

The minimum value for the field.

maxnumber

The maximum value for the field.

Description

Fires after the server-side summary values have been computed.

Discussion

The afterServerSideSummaryCompute event is triggered after the summary values for fields in the List control have been computed on the server.

A common use case for this event is to display the summary values in a control or DIV in the UX Component. For example:

// Get the total count for QTY and total cost:
var itemsOrdered = summary['QTY'].total;
var invoiceCost = summary['TOTAL'].total;

// Display values in two labels in the UX:
{dialog.object}.setValue('INVOICE_TOTAL',invoiceCost);
{dialog.object}.setValue('TOTAL_ITEMS_ORDERED',itemsOrdered);

Server side summary calculations are only available for lists based on SQL data.

The summary value will only be available for a field if you specified that it should be computed. Summary values can be enabled on the List Builder Fields pane in the Server-side section.

Videos 

Server-side Summary Values

For List controls that are based on SQL data, you can specify that summary data (e.g. total, avg, count, min and max) should be computed for certain columns in the List control. The summary computations are based on the List query (not on the rows actually visible in the List). In the case of a paginated List, there may be more rows in the query than are visible in the List. For example, the query might have 1,000,000 rows, but the list might show 20 rows at a time.

This video shows how a List control is configured to compute summary values, and then how the afterServerSideSummaryCompute event in the List is used to update a label on the UX component showing the summary values.

See Also