var
localData = {
"d"
:[{
"__type"
:
"type1"
,
"ClassNbr"
:
"5"
,
"SiteName"
:
"Name1"
,
"Train"
:
"Train1"
},{
"__type"
:
"type1"
,
"ClassNbr"
:
"4"
,
"SiteName"
:
"Name2"
,
"Train"
:
"Train2"
}]};
var
raDataSource =
new
kendo.data.DataSource({
type:
"odata"
,
transport: {
read: {
type:
"GET"
,
contentType:
"application/json; chartset=utf-8"
,
url: dataUrl,
dataType:
"jsonp"
,
jsonp:
true
,
jsonpCallback:
'callback'
}
},
data: {
siteID: si,
cceMode: mode,
endDate: encodeURIComponent(endDate),
Accept:
"application/json"
},
error:
function
(e) {
alert(
"Error: "
+ e);
},
schema: {
data:
"d"
},
model: {
fields: {
SiteName: { type:
"string"
},
Train: { type:
"string"
}
}
}
});
$(
"#grid"
).kendoGrid({
dataSource: raDataSource ,
height: 360,
columns: [
{ field:
"SiteName"
},
{ field:
"Train"
},
],
dataBound:
function
() { alert(
'bound'
);},
});
@{
ViewBag.Title = "TaskDetailListView";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div id="formcontainer">
<div id="demo">
Order ID: <input data-bind="value: OrderID" /><br />
Shipment Name: <label data-bind="text: ShipName" ></label>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
var productsSource = new kendo.data.DataSource({
transport: {
read: {
contentType: "application/json; charset=utf-8",
type: "GET",
dataType: "json",
url: "http://localhost:23794/api/Task/TaskItem"
}
},
schema: {
total: function (result) {
alert(JSON.stringify(result));
},
model: {
id: "OrderID",
fields: {
OrderID: { type: "number" },
ShipName: { type: "string" }
}
}
}
});
var viewModel = kendo.observable({
dataSource: productsSource
});
productsSource.fetch();
kendo.bind($("#formcontainer"), viewModel);
});
</script>
validation:{
required:
true
,
min:1,
digits:
true
}
<asp:DropDownList ID="comboBox" runat="server" DataTextField="monthfullname" DataValueField="mthid" CssClass="k-combobox" AutoPostBack="true" onselectedindexchanged="comboBox_SelectedIndexChanged"> </asp:DropDownList>
<script type="text/javascript"> $(document).ready(function () { $(".k-combobox").kendoComboBox(); }); </script>