kendoui test
by delebash
HTML
<div id="grid1"></div>
<div id="grid2"></div>
JavaScript
var ds1 = new kendo.data.DataSource({
transport: {
read: {
//using jsfiddle echo service to simulate JSON endpoint
url: "/echo/json/",
dataType: "json",
type: "POST",
data: {
// /echo/json/ echoes the JSON which you pass as an argument
json: JSON.stringify(
{
"country":[
{"codeLong":"AUT","codeShort":"AT","name":"Austria"},
{"codeLong":"BEL","codeShort":"BE","name":"Belgium"},
{"codeLong":"BGR","codeShort":"BG","name":"Bulgaria"}
]
}
)
}
}
},
schema: {
data: "country",
model: {
fields: {
codeLong: { type: "string" },
codeShort: { type: "string" },
name: { type: "string" }
}
}
}
});
var ds2 = new kendo.data.DataSource({
transport: {
read: {
//using jsfiddle echo service to simulate JSON endpoint
url: "/echo/json/",
dataType: "json",
type: "POST",
data: {
// /echo/json/ echoes the JSON which you pass as an argument
json: JSON.stringify(
[
{"codeLong":"AUT","codeShort":"AT","name":"Austria"},
{"codeLong":"BEL","codeShort":"BE","name":"Belgium"},
{"codeLong":"BGR","codeShort":"BG","name":"Bulgaria"}
]
)
}
}
},
schema: {
model: {
fields: {
codeLong: { type: "string" },
codeShort: { type: "string" },
name: { type: "string" }
}
}
}
});
$("#grid1").kendoGrid({
dataSource: ds1,
...