4 Answers, 1 is accepted
If the measures are defined correctly, then the widget will display them. Here is a Dojo demo, based on our online "Remote Binding" demo, that shows multiple measures correctly:
Regards,
Georgi Krustev
Telerik

Is it possible this does not work with the html helper or is my code flawed as I only get the last measure on the list at runtime:
@(Html.Kendo().PivotGrid<MAM.Models.vw_SP>()
.Name("pivotgrid")
.Configurator("#configurator")
.ColumnWidth(120)
.Height(570)
.BindTo(Model)
.DataSource(dataSource => dataSource
.Ajax()
.Schema(schema => schema
.Model(model => model.Id(p => p.SpendPlanID))
.Cube(cube => cube
.Dimensions(dimensions =>
{
dimensions.Add(model => model.CostCodeName).Caption("All Cost Codes");
dimensions.Add(model => model.TaskOrderNum).Caption("Task Order");
dimensions.Add(model => model.SubsystemName).Caption("Subsystem");
})
.Measures(measures =>
{
measures.Add("Planned").Format("{0:c}").Field(model => model.PlanAmt).AggregateName("sum");
measures.Add("Funded").Format("{0:c}").Field(model => model.FundingAmt).AggregateName("sum");
measures.Add("Spent").Format("{0:c}").Field(model => model.EstAmt).AggregateName("sum");
measures.Add("Remaining").Format("{0:c}").Field(model => model.Balance).AggregateName("sum");
})
))
.Columns(columns =>
{
columns.Add("CostCodeName").Expand(false);
})
.Rows(rows =>
{
rows.Add("TaskOrderNum").Expand(true);
rows.Add("SubsystemName").Expand(false);
})
.Measures(measures =>
{
measures.Values("Planned");
measures.Values("Funded");
measures.Values("Spent");
measures.Values("Remaining");
})
.Events(e => e.Error("onError"))
)
)
Thanks,
Erik
The MVC wrappers use, so called, Fluent Interface pattern. It is designed to set specific model option everytime the corresponding method is called. It will not combine values.
Based on the given information, any subsequent Values method call will override the previous set. If you would like to define a list of measures, set them as an array.
Regards,
Georgi Krustev
Telerik
