or
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ command: [{ className: "btn-destroy", name: "destroy", text: "Remove" }] }
],
editable: true,
dataSource: [ { name: "Jane Doe" } ]
});
change: function (e) {
var item = this.data()[0];
var chart = $("#training-chart").data("kendoChart");
// find the empty donut items.
if (item.numberCompleted == 0)
chart.options.series.splice(0, 1);
if(item.numberExpired == 0)
chart.options.series.splice(1, 1);
if (item.numberNotTaken == 0)
chart.options.series.splice(2, 1);
if (item.numberDue == 0)
chart.options.series.splice(3, 1);
chart.refresh();
},
data =
{
metaproperty : someUsefulInfo,
chartData : [ { data: 1 }, { data: 2 },{ data: 3 }]
}
public
ActionResult Reports_Read()
{
List<Report> reports =
new
List<Report>();
reports.Add(
new
Report
{
ReportId = Guid.NewGuid(),
Title =
"Lorem Ipsum"
,
BillToClient =
"Frosty Stevens"
,
MainRecipientContact =
"Dusty McLaren"
,
NextReportDue = DateTime.Now.AddDays(7),
PrimaryConsultant =
"Sprinkles O'Reilly"
,
ServiceCategoryCode =
"ABC"
});
reports.Add(
new
Report
{
ReportId = Guid.NewGuid(),
Title =
"Lorem Ipsum"
,
BillToClient =
"Harry Houdini"
,
MainRecipientContact =
"David Blaine"
,
NextReportDue = DateTime.Now.AddDays(7),
PrimaryConsultant =
"Dynamo"
,
ServiceCategoryCode =
"EFG"
});
return
Json(reports, JsonRequestBehavior.AllowGet);
}
<%:Html.Kendo().Grid<
ProcareGroup.Crm.Web.Models.Report
>()
.Name("grid")
.DataSource(ds => ds
.Ajax()
.ServerOperation(false)
.Read(r => {
r.Action("Reports_Read", "Dashboard");
}))
.Columns(c => {
c.Bound(r => r.Title);
c.Bound(r => r.PrimaryConsultant);
c.Bound(r => r.ServiceCategoryCode);
c.Bound(r => r.BillToClient);
c.Bound(r => r.NextReportDue);
})
.Pageable()
.Sortable()
%>