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

[Solved] Adding Multiple Subtotal Rows on a 2-dimensional Grid

1 Answer 311 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Randolph
Top achievements
Rank 1
Randolph asked on 10 Dec 2014, 02:37 AM
Hi,

We are building a 2-dimensional Grid using the Multicolumn feature and have done some customization to achieve the Y-axis headers as shown on the picture attached. Basically, we just set the class attribute of the y-column to 'k-grid-header'. The data is already aggregated beforehand and we are not using the aggregation feature of the kendo grid. 

So, the problem now is that we want to display a dynamic row for Subtotal, per the example, for Brushes (first 2 rows), Cat Food, etc. below the last row for each group. See the second attached file for an edited picture for our desired output. I say dynamic because depending on how our data is set up, the subtotal can be for each column, like this:
                      Phone              Chat 
                      Qty     Cost      Qty       Cost
Brushes           1         2            2            1
Brushes           3         1            2            4
Subtotals:        4         3            4            5

OR it can be a subtotal spanning throughout all the groups on the X-Axis, like this:                     
                      Phone              Chat 
                      Qty     Cost      Qty       Cost
Brushes           1         2            2            1
Brushes           3         1            2            4
Subtotals:                Qty: 8    Cost: 8

By the way, the subtotals are already computed beforehand as well. It is hard to insert a custom row, like just inserting a <tr> tag and just set the class and all, because the data coming in is dynamic. Here's the jsfiddle where the grid column and data is being built from a raw json that our server spits out. The outputs are in the console log. The first array in the console log output is the columns while the second array is the data.

Is there anyway to do this in a Kendo Grid? I'm thinking that this might be beyond what the Grid can support but maybe there is a workaround that might use or a feature that the grid has that supports such scenario.

Thanks







1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 11 Dec 2014, 03:38 PM
Hello Randolph,

I'm afraid, that the requested functionality is not supported and such layout is not possible to implement. Unfortunately, I cannot suggest you a workaround.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Randolph
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or