<ej-grid id="FlatGrid" allow-paging="true" show-summary="True">
. . .
<e-summary-rows>
<ej-summary-row title="Sum">
<e-summary-column>
<ej-summary-column summary-type="custom" custom-summary-value="findTotal" format="{0:C2}" display-column="Freight3" />
<e-summary-column>
</ej-summary-row>
</e-summary-rows>
<e-columns>
<e-column field="CustomerID" header-text="CustomerID" text-align="Right" width="75"></e-column>
<e-column field="Freight1" text-align="Right" format="{0:C2}" width="75"></e-column>
<e-column field="Freight2" text-align="Right" format="{0:C2}" width="75"></e-column>
<e-column field="Freight3" text-align="Right" format="{0:C2}" width="75"></e-column>
</e-columns>
</ej-grid>
[JS]
function findTotal() {
var gridObj = $("#Grid").ejGrid("instance");
var sum = ej.sum(gridObj.model.dataSource, "Freight1") + ej.sum(gridObj.model.dataSource, "Freight2") + ej.sum(gridObj.model.dataSource, "Freight3");
return sum;
} |