In certain cases, while dynamic editing you may want to sum all the values in a column and display it in an input text box.
You can achieve the above requirement by using create and cellSave events or an external button click event with the Sum summary type.
The create event is triggered when the Grid has rendered completely. In the argument of the create event, you can obtain the following details.
The cellSave event is triggered when a cell is edited and saved on batchEdit mode. In the argument of the cellSave event, you can obtain the following details.
The Sum Summary type yields the sum of the data. The parameters of the ej.sum are listed in the following table
In the following example, the Grid is rendered with batch editing enabled.
Figure 1: Initial Rendering
Note: The sum of the Freight column is calculated and displayed in the input text box.
Figure 2: After Editing and saving a cell
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|