Is it possible to use 1 PivotGrid and have pre-defined columns, rows and measures etc, that change based on an onclick event?
For instance i would have two buttons, "View 1" and "View 2", when one of these buttons are clicked the PivotGrid would re-drawn using defined cols, rows etc?
8 Answers, 1 is accepted
You should be able to achieve this with the approach shown in the following example:
Reload PivotGrid Configuration Options
By updating the DataSource configuration and assigning a new DataSource with the new options to the PivotGrid, you will be able to change the list of columns, measures, etc.
I can't seem to get this to work, i'm not sure if it's because i'm trying to use ajax and not the xmla.
Is this possible using the Ajax version?
I get undefined values everywhere, i'm currently using the same endpoint i would use when using the MVC asp.net version (works) with the 'ToDataSourceResult'
For the moment until i figure it out i'm using tabs with multiple pivotgrids and i also have issues there: https://www.telerik.com/forums/multipule-pivotgrids-(8)-not-loading-correctly
I tried with a DataSource bound to a regular OData service and it still worked:
Maybe I am missing something important about your scenario. Can you modify the Dojo to reproduce your case? Or are you actually using the MVC PivotGrid?
I'm not able to view it as your certificate has expired:
dojo.telerik.com uses an invalid security certificate. The certificate expired on Wednesday, April 4, 2018, 11:00 PM. The current time is Thursday, April 5, 2018, 6:17 AM. Error code: SEC_ERROR_EXPIRED_CERTIFICATE
I looked at your example, but this is using a different data structure to the "ToDataSourceResult" how can i implement this while using the "ToDataSourceResult"
The difference in the response format is mostly reflected to the way the initial parsing is done, but the rest of the configuration should be similar. When binding your Grid to a response returned as a DataSource result, the DataSource configuration would look like this:
You can ignore the quotes around options names, I just copied the generated DataSource code from the output of this demo:
PivotGrid / Remote binding
What you see above is pretty much the same script as what is generated by the MVC PivotGrid wrapper for the DataSource, with the exclusion of a couple of less important settings for the sake of simplicity.