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

Multi-Dimension data source

1 Answer 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 14 Oct 2016, 10:16 PM
Hello,

I'm trying to bind a multi dimensional data object to a kendo grid and am not having any success. My data looks something like this:

{
  "SalesSummary": {
      "ProNetSales": {
        "SubHeader": "Proj Net Sales",
        "Monday": 2800.00,
        "Tuesday": 3450.00,
        "Wednesday": 3100.00,
        "Thursday": 0,
        "Friday": 0,
        "Saturday": 0,
        "Sunday": 0,
        "WTD": 9350.00,
        "PTD": 54470.00
      },
      "ActualNetSales": {
        "SubHeader": "Actual Net Sales",
        "Monday": 2983.19,
        "Tuesday": 3728.17,
        "Wednesday": 3783.34,
        "Thursday": 0,
        "Friday": 0,
        "Saturday": 0,
        "Sunday": 0,
        "WTD": 10494.70,
        "PTD": 58022.00
      }
    },
"Transactions": {
      "Proj": {
        "SubHeader": "Proj",
        "Monday": 225.00,
        "Tuesday": 350.00,
        "Wednesday": 270.00,
        "Thursday": 0,
        "Friday": 0,
        "Saturday": 0,
        "Sunday": 0,
        "WTD": 845.00,
        "PTD": 4644.00
      },
      "Actual": {
        "SubHeader": "Actual",
        "Monday": 263.00,
        "Tuesday": 365.00,
        "Wednesday": 289.00,
        "Thursday": 0,
        "Friday": 0,
        "Saturday": 0,
        "Sunday": 0,
        "WTD": 917.00,
        "PTD": 4827.00
      }
    }
  }

So there are multiple dimensions with "SalesSummary" and "Transactions" as the top level dimension each having their own sub dimensions, each of which have the last layer which would be the row data that I'm trying to display. The reason I have the data structured this way is I actually need to display it on the page grouped by top level dimension, so "SalesSummary" then by the sub dimension within each top level. Is there a way to define a schema model to handle this when binding to a kendo grid? Or should I even be using a grid to display this type of data?

Best Regards,

Mike

1 Answer, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 18 Oct 2016, 01:22 PM
Hello Mike,

If I understand your requirement correctly, I believe you may achieve it with the Kendo UI Grid.

It seems that you need 2 main columns (column headers) with four columns altogether:

           SalesSummary      | Transactions
   |
proNetSales | actualNetSales    | Proj | Actual

For a demo on multi-column headers, please visit:

http://demos.telerik.com/kendo-ui/grid/multicolumnheaders

It looks like the dataItem already holds any aggregates that you may need, so if you would like to access them, you can do that with the use of a columns template:

http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.template 

I hope this helps to get you started.

Regards,
Alex
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps. 
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Share this question
or