afterClientSideSummaryCompute Event
Arguments
- csSummaryobject
An object that contains the computed values for each field in the List control that is configured to compute a summary value. Values are referenced using array syntax to get the summary values for a field. For example, csSummary['QTY'].total. Each field summary value entry can have the following properties:
Fields in csSummary 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 client-side summary values have been computed.
Discussion
The afterClientSideSummaryCompute event is triggered after the summary values for fields in the List control have been computed.
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 = csSummary['QTY'].total; var invoiceCost = csSummary['TOTAL'].total; // Display values in two labels in the UX: // need to put the .setValue in a setTimeout to be sure that the values are not overwritten when the UX is populated setTimeout(function() { {dialog.object}.setValue('INVOICE_TOTAL',invoiceCost); {dialog.object}.setValue('TOTAL_ITEMS_ORDERED',itemsOrdered); },100);
The summary value will only be available if you specified that it should be computed. Summary values can be enabled on the List Builder Fields pane in the Client-side section.
Formatting Summary Values
This event can be used to apply formatting to the summary values before they're displayed in a List's [Column footer template]. For example:
var qTotal = csSummary['QUANTITY'].total; if (qTotal > 1000) { csSummary['QUANTITY'].total = '<span style="color:green;font-weight:bold;">'+qTotal+'</span>'; }
If the Quantity is greater than 1000, the value will be displayed bold and green in the column footer. Otherwise, the value is unmodified.
If you modify the summary value to add HTML or other non-numeric data, the values cannot be used in computations without first removing the non-numeric markup.
See Also