or
<%: Html.Kendo().Grid<
CIS.Models.Patients.PatientModel
>()
.Name("grid")
.DataSource(dataSource => dataSource // Configure the grid data source
.Ajax() // Specify that ajax binding is used
.Read(read => read.Action("t1", "ttt")) // Set the action method which will return the data in JSON format
.PageSize(25)
)
.Columns(columns =>
{
columns.Bound(p => p.ID).ClientTemplate(
CIS.Models.Helpers.Controls.IconLink("Open", "ui-icon icon-folder-open", "ViewPatient", "Patients", new { patientID = "#= ID #" }) +
"<
div
title=\"Edit\" class=\"ui-icon icon-pencil edit-patient-btn\" patientID=\"#= ID #\" style=\"display: inline-block\"> </
div
>"+
"<
div
title=\"Remove\" class=\"ui-icon icon-trash remove-patient-btn\" patientID=\"#= ID #\" style=\"display: inline-block\"> </
div
>"
).Title("");
columns.Bound(p => p.initials).Title("Initial");
columns.Bound(p => p.dateOfBirth).Format("{0:dd/MM/yy}").Title("Date of Birth");
columns.Bound(p => p.gender).Title("Gender");
})
.Pageable()
.Sortable()
%>
@(Html.Kendo().Chart<GIPM.DAL.ViewModels.ProductsCountByCountryYear>()
.Name(
"linechart"
)
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.DataSource(ds => ds
.Read(read => read.Action(
"GetProductsCountByCountry"
,
"Products"
,
new
{ country =
""
}))
.Group(group => group.Add(model => model.Country))
.Sort(sort => sort.Add(model => model.Year).Ascending())
)
.Series(series =>
{
series.ScatterLine(model => model.Year, model => model.Count)
.Name(
"Country"
)
.GroupNameTemplate(
"#= group.value #"
);
})
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.YAxis(axis => axis.Numeric()
.Labels(labels => labels
.Format(
"{0}"
)
)
.MajorUnit(1)
)
.XAxis(axis => axis.Date()
.Labels(labels => labels.Format(
"{0}"
))
.MajorUnit(1)
)
)
public
ActionResult GetProductsCountByCountry(
string
country
)
{var query = _customsService.GetExportSeizedCountByCountry(country);
return
Json(query, JsonRequestBehavior.AllowGet);
}$(
"#chart"
).data(
"kendoChart"
).dataSource.read({ country: strcountry
});