Next
Update
Prev

The label for the footer can be set using JavaScript. The <labelJsFunction> property must be set to a JavaScript function name to change the label of the footer. This example demonstrates how to set the label of the footer in the Quarter, Month, Seoul columns using JavaScript.

...
<footers>
  <DataGridFooter height="35" >
      <DataGridFooterColumn label="Total, Average" textAlign="center" />
      <DataGridFooterColumn labelJsFunction="writeCount1" textAlign="center" />
      <DataGridFooterColumn labelJsFunction="writeCount2" textAlign="center" />
      <DataGridFooterColumn summaryOperation="SUM" dataColumn="{dg1col4}" labelJsFunction="writeCount3" ... />
      <DataGridFooterColumn summaryOperation="SUM" dataColumn="{dg1col5}" ... />
      <DataGridFooterColumn summaryOperation="SUM" dataColumn="{dg1col6}" ... />
  <DataGridFooter/>
</footers>
...

function writeCount1(column, data) {
  return "Total";
}

function writeCount2(column, data) {
  if (!collection && gridRoot)
    collection = gridRoot.getCollection();
  if (collection)
    return collection.getLength() + " Cases";
  else
    return "";
}

function writeCount3(column, data) {
  if (data)
    return data / 24;
  else
    return 0;
}

<DataGridFooterColumn >

summaryOperation SUM, MIN, MAX, AVG, COUNT

© 2017 KoolChart. All rights reserved.