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

How do your refresh / reload a pivot grid (data only) by using jquery / ajax

Thread ID:





131230 Jun 29,2017 01:25 PM UTC Jul 3,2017 05:46 AM UTC ASP.NET MVC 4
Tags: PivotGrid
Asked On June 29, 2017 01:25 PM UTC

My Pivot Grid works fine on initial load - JSON, but I'm having trouble finding a way to reload the data or update the data source. I'm using MVC, not the SF JavaScript version.  I'm a little lost on what client side method are available to achieve this.


Sastha Prathap Selvamoorthy [Syncfusion]
Replied On June 30, 2017 07:30 AM UTC

Hi John, 
Thanks for contacting Syncfusion Support. 
refreshPivotGrid” method is available to refresh the PivotGrid with new updated data. We have provided a sample code to refresh the PivotGrid using button click event. Please find the code snippet for your reference below. 
Sample Code: 
@Html.EJ().Pivot().PivotGrid("PivotGrid1").ClientSideEvents(clientSideEvents => clientSideEvents.Load("onLoad")).DataSource(dataSource => dataSource.Rows(rows => { rows.FieldName("Country").FieldCaption("Country").Add(); }).Columns(columns => { columns.FieldName("Product").FieldCaption("Product").Add(); }).Values(values => { values.FieldName("Amount").Add(); })) 
@Html.EJ().Button("Button1").Size(ButtonSize.Normal).Text("Click").ClientSideEvents(events => events.Click("btnClick")) 
    function btnClick(args) {  
              var pivotGridObj = $('#PivotGrid1').data("ejPivotGrid"); 
            type: "POST",  
            url: "../GetData",  // specify the url to get JSON data 
            contentType: 'application/json; charset=utf-8',  
            dataType: 'json',  
            success: function (val) {  
               pivotGridObj.model.dataSource.data = JSON.parse(val); // you can set the JSON data here 
               pivotGridObj.refreshPivotGrid(); // method call to refresh the PivotGrid 
Please let us know, if you need any further assistance. 
Sastha Prathap S.

Replied On June 30, 2017 09:06 PM UTC

Thank you for the solution .... I was also trying refresh a pivot chart , I see refreshPivotChart isn't a method for that object, do you know the correct method for refreshing a pivot chart?

Thanks again.

Replied On June 30, 2017 09:12 PM UTC

Figured it out by logging the methods to the console.



Sastha Prathap Selvamoorthy [Syncfusion]
Replied On July 3, 2017 05:46 AM UTC

Hi John, 
Thanks for the response. 
Please let us know, if you need any further assistance. 
Sastha Prathap 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

or the page will be automatically redirected to 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