We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reset Summary from ejGrid

Thread ID:





119411 Jun 17,2015 10:03 AM UTC Jun 18,2015 06:55 AM UTC JavaScript 1
Tags: ejGrid
Bruno Rodrigues
Asked On June 17, 2015 10:03 AM UTC


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 = [];

Alan Sangeeth S [Syncfusion]
Replied On June 18, 2015 06:55 AM UTC

Hi Bruno,

Thanks for using Syncfusion products.

We have analyzed your code snippets and found that you have updated Grid datasource through Grid option method which was the cause of the issue.

We have provided Grid method “dataSource” for updating Grid datasource and we suggest you to use the dataSource Grid method to resolve the issue. Please refer the following code snippets.

$("#GridCarTypes").ejGrid("dataSource", []);

Please let us know if you need any further assistance.

Alan Sangeeth S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon