Check before leave

Hello
I want to check that the sum is 100 before leave my view but I dont find how access the value of sum
Please find in attachment my view.

Thanks you.
Best Regards

Attachment: Detail_60b8c79f.zip

3 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 20, 2017 07:26 AM UTC

Hi Atolgan,  
 
Thanks for contacting Syncfusion Support.  
 
We could see you would like to calculate the sum of the Respective field and return it in the page unload. This can be done in the following methodology.  
 
<script> 
    window.addEventListener("beforeunload", function (e) { 
        var obj = $("#Grid").ejGrid("instance"); 
        var sum = ej.sum(obj.model.dataSource.dataSource.json, "Freight"); 
        alert(sum); 
    }); 
</script> 
 
Regards,  
Seeni Sakthi Kumar S. 



TH TheDarkBoz November 20, 2017 11:46 PM UTC

It is good thank you.


SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team November 21, 2017 04:03 AM UTC

Hi Atolgan,  
 
Thanks for the update.  
 
We are happy to hear that your requirement has been achieved and you are good to go. 
 
Regards,  
Seeni Sakthi Kumar S. 


Loader.
Up arrow icon