or
categoryAxis:
{
categories: ["Bulgaria", "France", "Germany", "Italy", "Spain", "UK", "US"]
}
@(Html.Kendo().Grid(Model)
.Name("Foo")
.Events(e => e.DataBound("server_databound"))
)
<script>
function
server_databound(){
alert(
"hey there!"
);
}
</script>
.DataSource(ds => ds
.Ajax()
)
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost:8080/databases/shipping/docs",
dataType: "json",
data: {
q: "javascript"
}
},
update: {
url: "http://localhost:8080/databases/shipping/docs",
dataType: "json"
}
},
schema: {
model: {
id: "id",
fields: {
Name: { type: "string" },
Telephone: { type: "string" },
Address: { type: "string" },
Suburb: { type: "string" },
City: { type: "string" },
Province: { type: "string" },
Country: { type: "string" },
PostalCode: { type: "string" },
DeliveryStatus: { type: "string" },
Packages: { type: "auto" }
}
}
}
});
var packageId;
function saveChanges(e) {
var button = e.button,
item = packageDataSource.get(button.data("itemId"));
packageId = item.ID;
dataSource.fetch(function () {
var packageToUpdate = dataSource.data()[id].Packages[packageId];
packageToUpdate.Status = "Delivered";
dataSource.sync();
console.log(dataSource);
});
}