This is a migrated thread and some comments may be shown as answers.

Batch Grid column total (unsaved)

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mitchell
Top achievements
Rank 1
Mitchell asked on 16 Mar 2015, 10:12 AM
Is there a way to get the total of a data column for an unsaved data grid? I want to check the column total before allowing a save back to the server.
Thanks

1 Answer, 1 is accepted

Sort by
0
Mitchell
Top achievements
Rank 1
answered on 16 Mar 2015, 10:40 AM
I have managed to do this now using the following.

var grandtotal = 0;

var grid = $('#TheGridName').data("kendoGrid");
var gridData = grid.dataSource.view();

for (var i = 0; i < gridData.length; i++) {
(
grandtotal += gridData[i].TheColumnName);
}
Tags
Grid
Asked by
Mitchell
Top achievements
Rank 1
Answers by
Mitchell
Top achievements
Rank 1
Share this question
or