This is a migrated thread and some comments may be shown as answers.

How to get the selected fields (slices)?

3 Answers 155 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Mahdi
Top achievements
Rank 1
Mahdi asked on 02 Jul 2018, 05:18 AM


Hello
I am trying to save kendo PivotGrid state for future load but I can't find a way to save/load the selected feilds (slices) using the "Fields to Include" menu along side with rows,columns and measures.

Is there any way to get and set selected fields in kendo PivotGrid?


3 Answers, 1 is accepted

Sort by
0
Preslav
Telerik team
answered on 03 Jul 2018, 12:56 PM
Hello Zand,

If anyone from the community encounters the same, I am pasting my reply from your support ticket on the same topic:

I understand that this functionality might be important for your project, however, for the time being, the PivotGrid does not support persisting its state out of the box. Feel free to upvote this feature request at our feedback portal:
Most voted suggestions will be considered for implementation.

For now, the only thing that I could suggest is using the APIs of the PivotDataSource to get/set columns, rows, and measures values.

For example, check this test Dojo:

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mahdi
Top achievements
Rank 1
answered on 11 Jul 2018, 05:18 AM

For any one who faced the same problem: I found that filters (and also selected members) could be retrieved and (a little bit tricky) set by filter method of PivotDataSource. By now this method is not documented in the PivotDataSource Api reference(here).

var filters = pivotgrid.dataSource.filter().filters;

 pivotgrid.dataSource.filter(filters);

0
Preslav
Telerik team
answered on 12 Jul 2018, 10:28 AM
Hello Mahdi,

Thank you for sharing this solution with the community.

On a side note, about the filter method, the PivotDataSource inherits from kendo.data.DataSource. Thus, all the methods in the regular DataSource are available in the PivotDataSource. Having said that, the documentation about the filter method is available here:

Regards,
Preslav
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PivotGrid
Asked by
Mahdi
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Mahdi
Top achievements
Rank 1
Share this question
or