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

Can the fields in PivotConfigurator be restricted

1 Answer 57 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 Jul 2018, 07:33 PM

Can the fields (dimensions and measures) listed in PivotConfigurator be restricted, so that we can restrict to only those relevant for the end user

Thanks

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 01 Aug 2018, 12:28 PM
Hi, Chris,

Unfortunately, the Kendo UI PivotGridConfigurator does not enable programmers to make the choice of showing certain fields via its options. However, it is possible to achieve that with the help of the Kendo UI TreeView API ( the tree view is the widget that shows the fields).

For example, you could add a one-time dataBound handler and use the data() method of the Kendo UI TreeView to set only the fields which make sense to the specifics of your scenario:

configurator.treeView.one("dataBound", function(e){
  var fieldsToKeep = [];
  var allItems = e.sender.dataSource.data();
 
  // loop through allItems and push the ones you want to keep in the fieldsToKeep array
 
  e.sender.dataSource.data(fieldsToKeep);
});

Here is a runnable example:

http://dojo.telerik.com/OWuYaCaW

- the one() method API reference: https://docs.telerik.com/kendo-ui/api/javascript/observable/methods/one

Let me know if you need further assistance with this approach.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PivotGrid
Asked by
Chris
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or