BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
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.
Thanks
@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"))
<script>
function btnClick(args) {
var pivotGridObj = $('#PivotGrid1').data("ejPivotGrid");
$.ajax({
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
},
});
}
</script> |
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.
Figured it out by logging the methods to the console.
console.log(pivot);
pivot.refreshControl();
thanks