var
spaceSeasonDS =
new
kendo.data.DataSource({
transport: {
read: {
url: window.stpURL +
"/SpaceAttribute"
,
dataType:
'xml'
,
data: {
action:
'getSeasons'
,
group:
function
(){
return
spaceGroup.value()
},
subgroup:
function
(){
return
spaceSubgroup.value()
}
},
cache:
false
,
complete: onReadComplete_Season
}
},
schema: {
type:
"xml"
,
data:
"/TABLE/SEASONS"
,
model: {
fields: {
item:
"item/text()"
}
}
},
error: raiseXmlDsErrorWindow
});
data: {
action:
'getSeasons'
,
group:
function
(){
return
spaceGroup.value()
},
subgroup:
function
(){
return
spaceSubgroup.value()
}
},
data:
function
() {
return
{
action:
'getSeasons'
,
group: spaceGroup.value(),
subgroup: spaceSubgroup.value()
}},
Hello,
I'm new to Kendo.
I'm trying to implement the following example:
http://demos.kendoui.com/web/grid/editing-inline.html
My server side code is ASP.Net
The problem is that while clicking new/update/delete inline options, i get a request to the server, to the relevant web method, however
no parameters are passed (the request object is empty).
Here is the client side code:
//////////////////////////////////////////////// Ready evet - Datasource
$(document).ready(function () {
var MydataSource = new kendo.data.DataSource({
transport: {
read: {
url: "HttpHandler.aspx/Line2AOIGetData",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
update: {
url: "HttpHandler.aspx/Line2AOIUpdate",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
destroy: {
url: "HttpHandler.aspx/Line2AOIDelete",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
create: {
url: "HttpHandler.aspx/Line2AOICreate",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch: false,
pageSize: 5,
schema: {
data: 'd',
model: {
id: "LineName",
fields: {
LineName: { editable: true, nullable: false, validation: { required: true} },
Equipmentname: { editable: true, nullable: false, validation: { required: true} }
}
}
}
});
//////////////////////////////////////////////// Grid
$("#theGrid").kendoGrid({
dataSource: MydataSource,
pageable: true,
toolbar: ["create"],
columns: [{ title: "Line", field: "LineName", width: "200px" },
{ title: "AOI Machine", field: "Equipmentname", width: "200px" },
{ command: ["edit", "destroy"], title: " ", width: "250px"}],
editable: "inline",
scrollable: false
});
});
Please advice.
Tnx
$("#grid").kendoGrid({
dataSource: {
data:airports,
schema: {
data: 'd'
}
},
columns: [
{
field: "airportName",
},
{
field: "airportCode"
}
]
});​
d: "[{"airportName":"BDL:Bradley International Airport, CT","airportCode":"BDL"},{"airportName":"HVN:Tweed New Haven Regional Airport, CT","airportCode":"HVN"},{"airportName":"EWR:Newark Liberty Intl, NJ","airportCode":"EWR"},{"airportName":"HPN:Whiteplains Airport,NY","airportCode":"HPN"},{"airportName":"JFK:John F. Kennedy Intl,NY","airportCode":"JFK"},{"airportName":"LGA:La Guardia Airport,NY","airportCode":"LGA"}]
};"
[WebMethod()]
public string GetAirportList()
{
List<
Airport
> Airports = new List<
Airport
>();
Airports.Add(new Airport {
airportCode = "BDL",
airportName = "BDL:Bradley International Airport, CT"
});
Airports.Add(new Airport {
airportCode = "HVN",
airportName = "HVN:Tweed New Haven Regional Airport, CT"
});
Airports.Add(new Airport {
airportCode = "EWR",
airportName = "EWR:Newark Liberty Intl, NJ"
});
Airports.Add(new Airport {
airportCode = "HPN",
airportName = "HPN:Whiteplains Airport,NY"
});
Airports.Add(new Airport {
airportCode = "JFK",
airportName = "JFK:John F. Kennedy Intl,NY"
});
Airports.Add(new Airport {
airportCode = "LGA",
airportName = "LGA:La Guardia Airport,NY"
});
return Newtonsoft.Json.JsonConvert.SerializeObject(Airports);
}
function buildChart() {
$("#chartPane").kendoChart({
title: {
text: "Type by Distributor"
},
dataSource: {
data: queryData
},
seriesDefaults: {
type: "column"
},
series: [{
field: "size",
name: "size"
}],
categoryAxis: {
field: "distributor",
labels: {
rotation: -90
}
}
});
}
var vendorAlphaDS = kendo.data.DataSource.create({
transport: {
read: {
url: "http://localhost/~termleech/conference/vendors/all",
dataType: "json"
}
}
});