or
@(Html.Kendo().Grid(Model.UnitTypes)
.Name("Grid")
.RowTemplate(@<
tr
>
<
td
>
<
div
>@item.Name</
div
>
</
td
>
<
td
>
<
div
>@item.CurrentRun.Operation.WellContract.Location</
div
>
</
td
>
<
td
>
<
div
>@item.CurrentRun.Operation.WellContract.Name</
div
>
</
td
>
<
td
>
<
div
>@item.CurrentRun.Id</
div
>
</
td
>
<
td
>
<
div
>@item.CurrentRun.RunTask</
div
>
</
td
>
<
td
>
<
div
>@item.Status.StatusText</
div
>
</
td
>
<
td
>
<
div
>Lamp</
div
>
</
td
>
<
td
>
<
div
>
<
div
class
=
"progress progress-warning"
>
<
div
class
=
"bar"
style
=
"width: 50%"
>
<
span
class
=
"offset6"
style
=
"color: #676767;"
>@Math.Round(item.CurrentRun.LatestWellLogEntry.Depth.Value, 2)</
span
>
</
div
>
</
div
>
</
div
>
</
td
>
<
td
>
<
div
>@Math.Round(item.CurrentRun.LatestWellLogEntry.Speed.Value, 2)</
div
>
</
td
>
<
td
>
<
div
>@Math.Round(item.CurrentRun.LatestWellLogEntry.Tension.Value, 2)</
div
>
</
td
>
<
td
>
<
div
>@item.CurrentRun.Name</
div
>
</
td
>
<
td
>
<
form
method
=
"POST"
action
=
"~/UnitDetails/Index/@item.Id"
>
<
input
type
=
"submit"
class
=
"k-button"
value
=
"Details"
/>
</
form
>
</
td
>
</
tr
>
)
.HtmlAttributes(new { style = "height:430px;" })
.Columns(columns =>
{
columns.Bound(p => p.Name).Title("Unit");
columns.Bound(p => p.CurrentRun.Operation.WellContract.Location).Title("Site");
columns.Bound(p => p.CurrentRun.Operation.WellContract.Name).Title("Well");
columns.Bound(p => p.CurrentRun.Id).Title("Run");
columns.Bound(p => p.CurrentRun.RunTask).Title("Task");
columns.Bound(p => p.CurrentRun.Operation.Description).Title("Operation");
columns.Bound(p => p.Status.StatusText).Title("Status");
columns.Bound(p => p.CurrentRun.LatestWellLogEntry.Depth).Title("Depth (m)");
columns.Bound(p => p.CurrentRun.LatestWellLogEntry.Speed).Title("Speed (m/min)");
columns.Bound(p => p.CurrentRun.LatestWellLogEntry.Tension).Title("Weight (kg)");
columns.Bound(p => p.CurrentRun.Name);
columns.Command(command => command.Custom("Edit Unit").Action("Index", "UnitDetails")).Width(85);
})
.DataSource(dataSource =>
dataSource.Server().Model(m => m.Id(p => p.Id)))
.Pageable()
.Scrollable(builder => builder.Height(250))
.Sortable())
@{
ViewBag.Title = "About Us";
}
<
h2
>About</
h2
>
<
p
>
Put content here. ABOUT
</
p
>
@(Html.Kendo().Grid<
KendoMVCWrappers.Models.Person
>()
.Name("gridEle2")
.Columns(cols =>
{
cols.Bound(e => e.Name)
.ClientTemplate("<
span
id
=
'btn_#=PersonID#'
>#:PersonID#</
span
>");
cols.Bound(e => e.Name)
.ClientTemplate("<
span
id
=
'btn2_#=PersonID#'
>#:PersonID#</
span
>");
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetPeople", "Home").Type(System.Web.Mvc.HttpVerbs.Post))
)
.Events(events => events.DataBound("xxx"))
)
<
script
>
function xxx(e) { alert('xxx');}
</
script
>
<
p
>
кст. Неговите корени са в класическата Латинска литература от 45г.пр.Хр., ... ...
</
p
>
var
peopleData = [
{ Id: 1, FirstName:
"Person"
, LastName:
"One"
, Birthday:
new
Date(1973, 11, 30) },
{ Id: 2, FirstName:
"Person"
, LastName:
"Two"
, Birthday:
new
Date(1967, 9, 5) }
];
var
peopleDataSource =
new
kendo.data.DataSource({
data: peopleData,
schema: {
model: {
id:
"Id"
,
fields: {
Id: { type:
"number"
},
FirstName: { type:
"string"
},
LastName: { type:
"string"
},
Birthday: {
type:
"date"
,
validation: {
rules: {
custom:
function
(input) {
if
(console != undefined) { console.log(input); }
var
today =
new
Date();
return
input < today;
}
},
messages: {
custom:
"Birthday cannot be in the future"
}
}
}
}
}
}
});
$(
"#personGrid"
).kendoGrid({
dataSource: peopleDataSource,
editable:
true
,
columns: [{
field:
"FirstName"
,
title:
"First Name"
},{
field:
"LastName"
,
title:
"Last Name"
},{
field:
"Birthday"
,
title:
"Birthday"
,
template:
"#= kendo.toString(Birthday, 'MM/dd/yyyy') #"
}]
});
View
var categories = $("#cmbWidgetCat1").kendoComboBox({
dataTextField: "Display",
dataValueField: "Value",
dataSource: {
type: "json",
transport: {
read: wsPath + "/GetTabItems"
}
}
}).data("kendoComboBox");
ASMX
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
public WidgetComboItem[] GetTabItems()
{
return new List<
WidgetComboItem
>
{
new WidgetComboItem {Display = "System Info", Value = "1"},
new WidgetComboItem {Display = "Datasets", Value = "2"},
new WidgetComboItem {Display = "Charts", Value = "3"},
}.ToArray();
}