I am building a dashboard application where the Arc Gauge's value will be updated periodically.
Multiple Arc Gauges are added as item in ListView.
While CenterTemplate can be bound to a model (see OEE property in OEEDataModel), it appears that i can't do the same for Arc Gauge's Value property.
How can i update each Arc Gauge's Value property in the ListView when the OEE value changes?
index.cshtml
@{
ViewData["Title"] = "Dashboard";
}
@model VelaMfgDashboard.Models.Dashboard.DashboardModel;
<
div
class
=
"dashboard-section k-content wide"
>
<
h1
>Dashboard: @Model.ProductionLine</
h1
>
<
div
class
=
"dashboard-table"
>
<
h2
class
=
"title"
>OEE</
h2
>
<
div
class
=
"data"
>
@(Html.Kendo().ListView(Model.OEEDatas)
.Name("oeeListView")
.TagName("div")
.ClientTemplateId("oee-template")
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.ServerOperation(false) // all data will be requested at once and data operations will be applied client-side
.Read(read => read.Action("OEEDatas_Read", "Dashboard")))
.Pageable(pageable => pageable
.Refresh(true)
.ButtonCount(5)
.PageSizes(new[] { 5, 15, 30 })
)
)
</
div
>
</
div
>
</
div
>
<
script
type
=
"text/x-kendo-tmpl"
id
=
"oee-template"
>
<
div
class
=
"oee-container"
k-widget>
<
dl
>
<
dt
>Machine #:MachineNo#</
dt
>
<
dd
>
@(Html.Kendo().ArcGauge()
.Name("oeeGauge")
.Value(80)
.Scale(x => x.Min(0).Max(100))
.CenterTemplate("#:OEE#%")
.ToClientTemplate()
)
</
dd
>
</
dl
>
</
div
>
</
script
>
public class DashboardModel
{
public string ProductionLine { get; set; }
public List<
OEEDataModel
> OEEDatas { get; set; }
public DashboardModel()
{
OEEDatas = new List<
OEEDataModel
>();
}
}
public class OEEDataModel
{
public double OEE { get; set; }
public int MachineNo { get; set; }
}