I would like use the same tecnic that the grid to call a handler to send the datasource, but It´s not working on PiVOT TABLE. I don´t know how to insert the "XSRF-TOKEN"
My Example.
function onLoad() {
console.log(this);
/*this.dataSource.dataSource.headers = [{ 'XSRF-TOKEN': $("input:hidden[name='__RequestVerificationToken']").val() }]*/; This is a TRY
//this.dataSourceSettings.dataSource.adaptor.addParams = [{ 'XSRF-TOKEN': $("input:hidden[name='__RequestVerificationToken']").val() }]; This is a TRY
}
public IActionResult OnGetPivotDataJson()
{
List
pivotData = new List(); pivotData.Add(new PivotData { Sold = 31, Amount = 52824, Country = "France", Products = "Mountain Bikes", Year = "FY 2015", Quarter = "Q1" });
pivotData.Add(new PivotData { Sold = 51, Amount = 86904, Country = "France", Products = "Mountain Bikes", Year = "FY 2015", Quarter = "Q2" });
pivotData.Add(new PivotData { Sold = 90, Amount = 153360, Country = "France", Products = "Mountain Bikes", Year = "FY 2015", Quarter = "Q3" });
pivotData.Add(new PivotData { Sold = 25, Amount = 42600, Country = "France", Products = "Mountain Bikes", Year = "FY 2015", Quarter = "Q4" });
pivotData.Add(new PivotData { Sold = 27, Amount = 46008, Country = "France", Products = "Mountain Bikes", Year = "FY 2016", Quarter = "Q1" });
string output = JsonConvert.SerializeObject(pivotData);
return new JsonResult(pivotData);
}
Thanks.