PivotGrid binding nested object

Posted by: productinfo on 31 December 2018, 4:08 am EST

    • Post Options:
    • Link

    Posted 31 December 2018, 4:08 am EST

    How can I bind nested object into pivotGrid and convert timestamp date to iso date ?

    Example :

     
        {
          "customer": {
            "code": "CARI01",
            "currency_rate_calculation": "EXCHANGE_SALES",
            "country": {
              "code": "TR",
              "description": "Turkey",
              "id": 1
            },
            "region": {
              "code": "",
              "description": "AKDENIZ",
              "id": 5
            },
            "address": "address",
          },
         "document_date": 1545339600000,
          "document_time": "16:54:26",
          "document_type": "CASH_PAYMENT",
          "local_debit": 30,
          "debit": 30,
          "credit": 0,
          "balance": -122.04
        }
    
    
  • Posted 2 January 2019, 12:33 am EST

    Hi,

    You may simply define the binding property of the field as ‘customer.code’ or ‘customer.country.code’ and it will be bound to the nested value.

    For converting the timestamp to a date, you may assign a function to the getValue property of the PivotField which will accept the current item as a parameter and return the calculated value for the field.

    Please refer to the following sample which demonstrates the same:

    https://stackblitz.com/edit/angular-gaukwe?file=src%2Fapp%2Fapp.component.ts

    More on getValue property: https://demos.wijmo.com/5/Angular/WijmoHelp/WijmoHelp/topic/wijmo.olap.PivotField.Class.html#getValue

    ~Sharad

  • Posted 2 January 2019, 2:50 am EST

    ** Assertion failed in Wijmo: Unknown property “getValue”.

  • Posted 3 January 2019, 12:21 am EST

    The ‘getValue’ property was added from the version 5.20182.524+. Please update to the latest version and let us know if you still face any issues.

    For older versions, we need to modify the data source before assigning it to the pivot.

  • Posted 3 January 2019, 9:05 am EST

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels