Pivot Save State & Bug with Date Groupings

You can view a simple sample project for issues 1 and 2 here: http://www.tgmt-systems.com/syncFusion/


Issue #1 - Persist State with no Data Source Performance
See this thread:

The problem with their current method is it goes to a string... if I have 94k records, it means the code in getPersistData will first convert the 94k json records to a string. Then the code to get state without data will parse the 94k records from the string back to json...

var dataSource = JSON.parse(this.pivotObj.getPersistData()).dataSourceSettings;

We need a method like getPersistData, which returns JSON not a string so we can easily save the full state WITHOUT the dataSource. I hacked one in my version by adding this method in the pivot code itself (had to do that so methods G, V, etc. are in the proper namespace). The different is that this new method returns the JSON instead of the stringified version.

,t.prototype.addOnPersist2=function(e){for(var t=this,i={},n=0,r=e;nreturn i;}

and then by adding another getter that uses it

ej.pivotview.PivotView.prototype.getPersistData2 = function( )
{
var e = this.gridSettings.columnRender, t = this.chartSettings.load;
this.gridSettings.columnRender = void 0, this.chartSettings.tooltipRender = void 0, this.chartSettings.load = void 0;
var i = this.addOnPersist2(
[
"dataSourceSettings",
"pivotValues",
"gridSettings",
"chartSettings",
"displayOption"
] );
return i;
};


Issue #2 - Date field with grouping not in columns or rows
In sync project index.js comment out the columns as shown below so all fields appear at the top of the pivot. The "virtual fields" for the month and year groupings are broken as shown below.

/*,columns :
[
{
name : 'Date',
caption : "My Date"
}
]*/

image.png

Issue #3 - Persist State has a bug with Groupings on Date fields.
Re-add the columns definition and load the page.

The pivot displays correctly:
image.png

1. Move the Years (My Date) field to the top of the pivot.
2. Click on the Test Persist link. It will execute the testPersist function below. When the state is reloaded after 100 ms, the Years field is on top but broken.

function testPersist( )
{
var persist = pivotObj.getPersistData();

setTimeout( function( )
{
pivotObj.loadPersistData( persist );
}, 100 );
}

image.png


6 Replies

MM Manikandan Murugesan Syncfusion Team November 24, 2021 02:09 PM UTC

Hi Thierry, 
 
We are currently analyzing the reported problems at our end, and we will provide further details within two business days (November 26, 2021). We're also unable to view the images you've attached. So, could you please re-upload the images? This will help us to investigate the reported problems at our end and provide a solution at the earliest. 
Please let us know if you have any concerns. 
 
Regards,  
Manikandan 



TH Thierry November 24, 2021 05:25 PM UTC

Issue 2 Image:



Issue 3 Image:





TH Thierry November 24, 2021 05:31 PM UTC

Issue 2 images can be seen at https://www.dropbox.com/s/py5s1b7sd8yf9mh/issue%202%20image.png?dl=0


Issue 3 images can be seen at https://www.dropbox.com/s/a7v2yhgi40z62td/issue%203%20image.png?dl=0


They are also attached in a zip file to this thread


Attachment: images_50a4e1a5.zip


TH Thierry November 24, 2021 05:34 PM UTC

Last image added as zip file


Attachment: issue_4_image_ba1f11d0.zip


MM Manikandan Murugesan Syncfusion Team November 25, 2021 03:04 PM UTC

Hi Thierry, 
 
Please find the response below. 
 
Query 
Comments 
Issue #1 - Persist State with no Data Source Performance 
Kindly refer to the following code example to get the persist report as string without data source. 
 
Code Example: 
ej.base.Component.prototype.addOnPersist1 = function (options) { 
  var _this = this; 
  var persistObj = {}; 
  for (var _i = 0options_1 = options_i < options_1.length_i++) { 
    var key = options_1[_i]; 
    var objValue = void 0; 
    // eslint-disable-next-line 
    objValue = ej.base.getValue(keythis); 
    if (!ej.base.isUndefined(objValue)) { 
      ej.base.setValue(keythis.getActualProperties(objValue), persistObj); 
    } 
  } 
  if (this.getModuleName() === 'pivotview') { 
    persistObj.dataSourceSettings.dataSource = []; 
  } 
  return JSON.stringify(persistObjfunction (keyvalue) { 
    return _this.getActualProperties(value); 
  }); 
}; 
 
 
Meanwhile, we have prepared a sample for your reference. Please find it from below link. 
 
Issue #2 - Date field with grouping not in columns or rows 
We can be able to reproduce the problem at our end. We have considered this as a bug and logged a defect report in our database. And the fix will be available in our Volume 4 release which is estimated to be rolled out at the end of December 2021. You can track the same by using below link. 
 
 
 
Issue #3 - Persist State has a bug with Groupings on Date fields. 
 
Please let us know if you have any concerns. 
 
Regards,  
Manikandan 



MM Manikandan Murugesan Syncfusion Team December 20, 2021 05:07 PM UTC

Hi Thierry, 
 
We are glad to announce that our Essential Studio 2021 Volume 4 Main Release V19.4.0.38 is rolled out and fix for the issue “Caption not applied properly for grouping fields” has been included in this release. Please refer to the following sample. 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you require any further assistance. 
 
Regards, 
Manikandan 


Loader.
Up arrow icon