Populate ejs-pivotfieldlist and ejs-pivotview data from ajax json call

I'm trying to set the datasource for the pivot field list and the pivot view from the ajax call and json response.









But the result is like this:



There is not row labels on the left.
Is there some example like the one I need?

Thanks!
Bernard.


13 Replies 1 reply marked as answer

SS Saranya Sivan Syncfusion Team March 29, 2021 05:13 PM UTC

Hi Bernard, 
 
We are checking on the reported issue at our end. We will update the further details within two business days. 
 
Regards, 
Saranya S. 



SS Saranya Sivan Syncfusion Team March 31, 2021 01:19 PM UTC

Hi Bernard,  
  
We have checked the reported problem at our end but we are unable to reproduce the problem at our end. Meanwhile we have prepared a sample to set the data source for the  pivot view from the ajax call. Please find the sample below, 
  
  
If still the problem exists, kindly reproduce the problem in the provided sample and revert us (or) send your sample that replicating the problem. This would be a very helpful for us to investigate the reported problem at our end and provide the solution at earliest.   
   
Regards, 
Saranya Sivan. 
 


Marked as answer

BJ Bernard Jurlina April 1, 2021 09:12 PM UTC

Hi Saranya,

I was using 18.3. version of .net core controls and when I updated to the latest 19.1., everything is working great now.

Thanks again!

Regards,
Bernard.


MM Manikandan Murugesan Syncfusion Team April 2, 2021 01:57 PM UTC

Hi Bernard, 

Please let us know if you have any other queries. We will be happy to assist you. 

Thanks, 
Manikandan 



BJ Bernard Jurlina April 2, 2021 05:20 PM UTC

Just one more question. 
Why the field format not working for my example?







Thanks!
Bernard.


SS Saranya Sivan Syncfusion Team April 5, 2021 02:57 PM UTC

Hi Bernard, 
  
We have checked your codes where you have used “e-datasourcesettings” in both field list and pivot table components. But for static field list option, this should be set in field list component alone which is the correct way. So, kindly follow this to avoid the reported issue. Meanwhile, we have prepared a sample for your reference. This is available in below link. 
  
  
If still the problem exists, kindly reproduce the problem in the provided sample and revert us (or) send your sample that replicating the problem. This would be a very helpful for us to investigate the reported problem at our end and provide the solution at earliest.   
   
Regards, 
Saranya Sivan. 
 



BJ Bernard Jurlina April 5, 2021 07:15 PM UTC

Hi Saranya!

Yes, this did the trick:

var pivotFieldObj = document.getElementById('pivotfieldlist').ej2_instances[0];
                    pivotFieldObj.setProperties(
                        {
                            dataSourceSettings: {
                                dataSource: result,
                                formatSettings: [{ name: 'amount', format: 'N2' }],
                            }
                        },
                        true
                    );
                    pivotFieldObj.refresh();

Regards!
Bernard.


ME Mouli Eswararao Syncfusion Team April 6, 2021 12:16 PM UTC

Hi Bernard, 
Thanks for the reply. Please contact us if you have any further queries we are happy to assist you.

Regards,
Mouli 



BJ Bernard Jurlina April 6, 2021 09:31 PM UTC

Hi Mouli!

How can I loop all field list and set the caption for each field?
For example, I want to set the caption for the field "NetoPremija" into "Neto premija".



Maybe something like this?



Thanks!
Bernard.


SS Saranya Sivan Syncfusion Team April 7, 2021 01:40 PM UTC

Hi Bernard, 
  
Your requirement can be achieved by using the field mapping feature but currently there is a known issue in field mapping wrapper(tag). Also, we have logged a bug defect report in our data base. And it will be available in weekly patch release which is estimated to be rolled in the end of April, 2021.  
  
You can track the task in the following link.  
  
  
Meanwhile, we have prepared a sample to achieve your requirement on using Load event click. Please find the sample and UG below, 
  
Code Snippet: 
  
<script> 
    function onLoad(args) { 
        var pivotGridObj = document.getElementById('PivotView').ej2_instances[0]; 
        pivotGridObj.setProperties({ 
            dataSourceSettings: { 
                fieldMapping: [ 
                    { name: 'Quarter', caption: 'Production Quarter' }, 
                    { name: 'Amount', caption: 'Sold Amount' }, 
                ] 
            } 
        }, true); 
    } 
</script> 
  
  
  
Please let us know if you have any concerns.   
  
Regards, 
Saranya Sivan. 




BJ Bernard Jurlina April 11, 2021 07:37 PM UTC

Hi Saranya,

fieldMapping is the right answer.
Thank you very much.

Regards,
Bernard.


SS Saranya Sivan Syncfusion Team April 12, 2021 11:25 AM UTC

Hi Bernard, 
 
Thanks for the reply. 
  
Please let us know if you have any other queries. We are always happy to assist you.  
  
Regards, 
  
Saranya. 
 



SS Saranya Sivan Syncfusion Team May 4, 2021 05:10 PM UTC

Hi Bernard, 
   
We have fixed the reported issue in the weekly release (v19.1.0.59). Meanwhile, we have prepared a sample for your reference. Kindly check the sample in the below link.   
   
   
Please let us know if you have concerns.   
   
Regards,   
Saranya. 
 


Loader.
Up arrow icon