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.
Unfortunately, activation email could not send to your email. Please try again.

Reset Summary from ejGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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


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

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.

Regards,
Alan Sangeeth S

CONFIRMATION

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.

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.

;