or
<
script
id
=
"popup_editor"
type
=
"text/x-kendo-template"
>
...
<
input
name
=
"test"
id
=
"test"
>
...
</
script
>
<
script
>
$(document).ready(function () {
$("#test").kendoAutoComplete({
dataSource: data,
filter: "startswith",
placeholder: "Select country...",
separator: ", "
});
</
script
>
<
input
id
=
"EventDate"
type
=
"text"
value
=
"24/08/2012"
name
=
"EventDate"
>
$("#EventDate").kendoDatePicker({
format: "D"
})
$("#EventDate").kendoDatePicker({
format: "D",
value:
new
Date($(
"#EventDateEnd"
).val())
});
@{
ViewBag.Title = "Employees";
}
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
//
$("#kjsimpleGrid").kendoGrid({
groupable: true, scrollable: true,
sortable: true, pageable: true, filterable: true,
dataSource: {
transport: { read: { url: "/Grid/GetEmployees" } }
},
columns: [
{ title: "Id", field: "EmployeeID", width: 80 },
{ title: "Last", field: "LastName", width: 100 },
{ title: "First", field: "FirstName", width: 100 },
{ title: "Title", field: "Title", width: 200 },
{ title: "City", field: "City", width: 200 },
{ title: "Region", field: "Region"}]
});
});
</
script
>
<
fieldset
><
legend
>Employees</
legend
>
<
br
/>
<
div
id
=
"kjsimpleGrid"
>
</
div
>
</
fieldset
>
//
/// <
summary
>
/// GET: /Grid/
/// </
summary
>
/// <
returns
></
returns
>
public ActionResult Index()
{
return View( );
}
//
/// <
summary
>
/// GET: /Grid/GetEmployees/
/// </
summary
>
/// <
returns
></
returns
>
public JsonResult GetEmployees()
{
var _emps =
(from e in _db.Employees
select new
{
EmployeeID = e.EmployeeID,
LastName = e.LastName,
FirstName = e.FirstName,
Title = e.Title,
TitleOfCourtesy = e.TitleOfCourtesy,
BirthDate = e.BirthDate,
HireDate = e.HireDate,
Address = e.Address,
City = e.City,
Region = (e.Region == null ? "": e.Region)
}).ToList();
return Json(_emps, JsonRequestBehavior.AllowGet);
}
GetEmployees
.