Hello,
I have been looking forward to see if there was any solution to my issue, however I didn't find any.
My problem is the following, I have an ejGrid which has a column that is a quantity. I Could use summaryType: ej.Grid.SummaryType.Custom or summaryType: ej.Grid.SummaryType.Sum.
Both worked fine to perform the sum. However I've a button which clears all form data, included the ejGrid data source, but the summary stays with the last resulted value.
Can Anyone help me to solve this?
Code below
Custom Function
function CarQuantity() {
var gridObj = $("#GridCarTypes").ejGrid("instance")
var qtCar = 0;
var Quantity = "Quantidade"
for (var i = 0; i < gridObj.model.dataSource.length; i = i + 1) {
qtCar = parseInt(qtCar) + parseInt(gridObj.model.dataSource[i].QUANTITY);
}
return (qtCar);
to clear the grid
$("#GridCarTypes").ejGrid("option", { dataSource: [] });
var instance = $("#GridCarTypes").ejGrid("instance");
instance._filterCollection = [];
instance._currentJsonData = [];