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

Control existing Pivotgrid as a JavaScript object

4 Answers 82 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
fabio2x4
Top achievements
Rank 1
fabio2x4 asked on 24 Jul 2015, 04:34 PM

I'​m ​trying [ UI for ASP.NET MVC Q2 2015 ]'s pivotgrid object, (in order to substantiate if it fits the needs of the organization which I belong. Also, I haven't read the terms and conditions about creating threads. Sorry if that information was unnecessary.). The object:

<%: Html.Kendo().PivotGrid<T>()
    .Name("pivotgrid").Configurator("#configurator")
    .BindTo(Model).DataSource(dataSource => dataSource

/* etcetera */

 %> 

It is required to set active fields on Columns, Rows, etc, via Javascript, or C# for that matter, after the object is created. ​It is indispensable to load some report configuration model associated to user profiles. The pivot grid object would be used by some sort of administrator user (who would export reports configuration built with the "configurator"), and by other users who would only be able to see the report and do some minor sets on those previously determined measures, rows, columns.

Thank you,

Great tool! By the way

 

 

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 28 Jul 2015, 11:16 AM
Hello fabio2x4,

Generally speaking, the PivotGrid widget (generated by the PivotGrid wrapper) allows to change/update its configuration using the available API. It is important to know that the widget uses a dedicated PivotDataSource that also has an API that can be used to update the columns, rows, measures programatically. You can check the available "how-to" demos for more details:
Let me know if I am missing something.

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
fabio2x4
Top achievements
Rank 1
answered on 29 Jul 2015, 06:12 PM

Thanks for your kind reply Georgi.
Sorry if my inquiry was not clear enough. I´m narrating the stage, due to a language issue more than anything. We are looking for a way to save the state of the pivotgrid object. The datasource could be a large matrix of data with a number of fields (all of them would appear in the configurator). The user selects only some of those fields and they become active in the pivotgrid. Then, and this is what I´m missing and the reason of the post I made, the user saves this configuration or state of the pivotgrid.
As I have the object renderized or built via <%: tml.Kendo().PivotGrid<​T>( ) %>, I thought it would be a fair approach to retrieve it later via javascript and get its active fields. By building the object in that fashion I have already accomplished loading an improvised pivotgrid state using lambda expressions, and it works fine. Saving that state is my gap.
Thanks a lot for your time,

0
Accepted
Georgi Krustev
Telerik team
answered on 31 Jul 2015, 10:35 AM
Hello fabio2x4,

Thank you for the clarification. The widget can expose its current configuration through the PivotDataSource API. Basically, you will need to retrieve the columns, rows and measures options using JavaScript. Save this object in your DB and then on subsequent widget reload, you can re-set those options using the very same API. Here is a Dojo demo that demonstrates one possible way to accomplish this task:
The other option is to re-set the whole PivotDataSource. For that task you can use setDataSource method.

Regards,
Georgi Krustev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
fabio2x4
Top achievements
Rank 1
answered on 31 Jul 2015, 02:11 PM

Thanks a lot Georgi,

Very helpful your explanation and the Dojo demo.

Regards

 

 

Tags
PivotGrid
Asked by
fabio2x4
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
fabio2x4
Top achievements
Rank 1
Share this question
or