Replacing data within PivotGrid

14 posts, 0 answers
  1. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 08 Sep 2014 Link to this post

    Hi all

    I have to the following structure which I wanna use with Pivotgrid:

    {
        "Name":  Ackermann,
        "First Name": Rolf,
        "Statistic": [
            {
                "Year": 2004,
                "Product": "Book",
                "Quantity": 10
            }, {
                "Year": 2005,
                "Product": "Booklet",
                "Quantity": 35
            }, {
                "Year": 2005,
                "Product": "Book",
                "Quantity": 18
            }
        ]
    }

    Now I have a interacive page where the user can search another customer. After the search I want to display the customers data in the PivotGrid. But for every customer the user searches an additional PivotGrid is added (1st time: 1 grid, 2nd time: 2 grids, 3th time: 3 grid etc.).

    How can I avoid this?

  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 09 Sep 2014 Link to this post

    Hello Rolf,

    It is not very clear how the widget is initialized and why it is added multiple times. Could you provide more information about your current implementation? A runnable Dojo demo will be great.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 09 Sep 2014 Link to this post

    Hello,

    Here is the correct link to the Dojo site.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  5. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 10 Sep 2014 in reply to Georgi Krustev Link to this post

    Hi Georgi

    Sorry for the delay, we are currently very busy.

    Anyhow:
    Imaging a form which is able to search for a customer (like a query form). The user can input a customer name and press the search button. If the customer could be found we fill up a PivotGrid with similar information like I wrote in this thread.

    The problem is now that if you only exchange the data via the dataSource property it will show the old data (not replacing the data). If you build a new dataSource and assign it to $("pivotgrid").kendoPivotGrid({...}) it will add the whole data as a separate PivotTable (e.g. if you search 2 times you will have 2 PivotGrid, if you search 3 times you will have 3 PivotGrid etc.).

    Regarding Dojo: I can build an example but I'm only working this week, next week I'm in vacation.

    Best regards
    Rolf
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 11 Sep 2014 Link to this post

    Hello Rolf,

    I would suggest you use the widget's setDataSource method to change the data. Additional widget initialization is not supported and will lead to undesired behaviors, like the one you've mentioned.

    Give it a try and let me know if this doesn't solve the problem.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 11 Sep 2014 in reply to Georgi Krustev Link to this post

    Hello Georgi

    Thanks for your reply. I already tried this but with no success. I've done the following:

    a) setDataSource( newData );
    b) refresh();

    But the old data will be still shown. I have seen that you added a new version (2014.2.909). I will give this version a try and will reply later.

    Thanks and bes regards
    Rolf
  8. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 11 Sep 2014 Link to this post

    BTW Georgi

    The PivotGrid looks very nice but expanding / collapsing column categories (from the 2nd  column on) works only in 2014.2.716 (with some calculation errors) but neither before nor after this version (even not 2014.2.909).

    Best regards
    Rolf
  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 11 Sep 2014 Link to this post

    Hi Rolf,

    Find my comments below:

    a) setDataSource( newData );
    Here is a Dojo demo demonstrating how the setDataSource method affects PivotGrid widget.

    b) refresh();

    This will just re-draw widget.

    There is a known issue regarding drill-down functionality (even though I am not sure if it is related to the one you mentioned). We will address the bugs for the upcoming official release of Kendo UI due the beginning of October.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  10. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 12 Sep 2014 in reply to Georgi Krustev Link to this post

    Hi Georgi

    Many thanks for that sample. Regarding this...

    a) You're using the same data: products, only the rows/columns are exchanged (I have to try it that ways also)
    b) Do the following steps and the data will not be loaded any longer (tested with Firefox, Chrome and IE)

      1) Expand the column under "Produce"
      2) Press "Change DS" button
          ==> The loading icon will stay remain and data are not longer shown

    Regarding drill-down functionality:

    a) Version 20014.2.716 of kendo.all.min.js the shifting / unshift of columns during expanding resp. collapsing the rows was working
         but the calculation on the last column is totally false.

    I created a document with test cases where you can see the drill-down problem.

    Best regards
    Rolf
  11. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 16 Sep 2014 Link to this post

    Hello Rolf,

    Thank you for the detailed test cases.

    Issue: Do the following steps and the data will not be loaded any longer (tested with Firefox, Chrome and IE)

    This is a known bug, which is already addressed. You can try the next internal build of Kendo UI and let me know if the problem is still there. The build most probably will be release in the middle of this week.

    ​Issue: Version 20014.2.716 of kendo.all.min.js the shifting / unshift of columns during expanding resp. collapsing the rows was working, but the calculation on the last column is totally false.

    This problem is related to the previous one and it's caused by the same bug in the rendering. Download the next internal build and should be addressed.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  12. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 24 Sep 2014 in reply to Georgi Krustev Link to this post

    Hi Georgi

    This problem is related to the previous one and it's caused by the same bug in the rendering. Download the next internal build and should be addressed.

    Version 2014.2.923 doesn't solve the problem.

    Kind regards
    Rolf
  13. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 25 Sep 2014 Link to this post

    Hello Rolf,

    The fix was not included in production (last internal build) and that is why the problem still persists. Please excuse me for the incorrect information. The next one, scheduled for this Friday, will include the fix. 

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  14. Rolf
    Rolf  avatar
    8 posts
    Member since:
    Aug 2014

    Posted 01 Oct 2014 in reply to Georgi Krustev Link to this post

    Hi Georgi

    I tested 2014.2.926 with different browsers (IE, Chrome, Firefox)

    The best results (even not 100% perfect) we are getting with Chrome (collapse / expand looks great, but the numbers are not correct all the times). Firefox has still the problem that if you're expanding the second column it will be expanded but not collapsed. IE is not worth is explain (doesn't work properly at all).

    Best regards
    Rolf
  15. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 02 Oct 2014 Link to this post

    Hello Rolf,

    Thank you for the feedback. I was able to replicate the incorrect expand/collapse behavior in IE and Firefox.
    We will fix it for the upcoming official release of Kendo UI due the mid of next week.

    As to the incorrect calculation, could you share with us more information about the problem. I tested the Dojo demo, but the calculation seemed to be OK. Any additional code, demo or steps will be greatly appreciated.

    Regards,
    Georgi Krustev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready