or
<!DOCTYPE html>
<
html
>
<
head
>
<
title
></
title
>
<
script
src
=
"js/jquery.min.js"
></
script
>
<
script
src
=
"js/kendo.all.js"
></
script
>
<
link
href
=
"css/kendo.common.css"
rel
=
"stylesheet"
/>
<
link
href
=
"css/kendo.default.css"
rel
=
"stylesheet"
/>
</
head
>
<
body
>
<
div
id
=
"example"
class
=
"k-content"
>
<
div
id
=
"grid"
></
div
>
<
script
>
$(document).ready(function (){
dataSource = new kendo.data.DataSource({
transport: {
read:{
dataType: "jsonp"
},
update: {
dataType: "jsonp"
},
destroy: {
dataType: "jsonp"
},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
batch: true,
pageSize: 10,
schema: {
model: {
id: "ID",
fields: {
Name: { editable: false, nullable: false },
Title: { editable: true, nullable: false },
URL: { editable: true, nullable: false },
FTP: { editable: true, nullable: false },
Status: { type: "string", editable:false},
Remarks: { editable: false, nullable: false }
}
}
}
});
$("#grid").kendoGrid({
dataSource: dataSource,
navigatable: true,
pageable: true,
height: 650,
scrollable: true,
sortable: true,
toolbar: ["save", "cancel"],
columns: [
{ field: "Name", width: "60px" },
{ field: "URL", width: "350px" },
{ field: "Title", width: "150px" },
{ field: "FTP", width: "150px" },
// { field: "Date", width: "150px" },
// { field: "Status", width: "100px" },
{field: "Status", width:"150px", template: function(container, options) {
$('<
input
name
=
"' + options.field + '"
/>').appendTo(container).kendoComboBox([
{text: "Item1", value: "1"},
{text: "Item2", value: "2"}
]);
}
},
{ field: "Remarks", width: "50px",template:('<
a
href
=
"http://www.xyz.com?eid=#=ID#"
target
=
"_blank"
>#=Remarks#</
a
>')},
{ command: "destroy", title: "Delete", width: "100px" }],
editable: true
});
});
</
script
>
</
div
>
</
body
>
</
html
>
template: ('<
select
id
=
"combobox"
name
=
"Status"
/><
option
value
=
"#=Status#"
>#=Status#</
option
><
option
value
=
"Added"
>Added</
option
><
option
value
=
"Rejected"
>Rejected</
option
></
select
>')
[WebInvoke(Method =
"POST"
, UriTemplate =
"/{id}"
)]
public
void
Upload(HttpRequestMessage request,
string
id)
{
var task = request.Content.ReadAsMultipartAsync();
task.Wait();