Control existing Pivotgrid as a JavaScript object

5 posts, 1 answers
  1. fabio2x4
    fabio2x4 avatar
    5 posts
    Member since:
    Apr 2012

    Posted 24 Jul 2015 Link to this post

    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

     

     

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 28 Jul 2015 Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. fabio2x4
    fabio2x4 avatar
    5 posts
    Member since:
    Apr 2012

    Posted 29 Jul 2015 Link to this post

    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,

  5. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 31 Jul 2015 Link to this post

    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
  6. fabio2x4
    fabio2x4 avatar
    5 posts
    Member since:
    Apr 2012

    Posted 31 Jul 2015 in reply to Georgi Krustev Link to this post

    Thanks a lot Georgi,

    Very helpful your explanation and the Dojo demo.

    Regards

     

     

Back to Top
UI for ASP.NET MVC is VS 2017 Ready