Edit Data in a Kendo ListView from Grouped List
I am trying to make a simple modification to one of the Kendo samples
which breaks some functionality. I'm not sure I understand why and would
like some help updating it to work correctly.
There is a sample on the web site under mobile->listview->editing example.
The example lists differnt types food items and when you click on one of
them a detail view comes up.
The only modification i am making is setting the datasource to group. The
grouping works fine but once I click on an item, it fails to populate the
details. (uid is 'undefined' in the url).
Is there a way to group and still retain the functionality?
Thanks
Code is here: http://demos.kendoui.com/mobile/listview/index.html#/ Choose
the Editing Example
var crudServiceBaseUrl = "http://demos.kendoui.com/service",
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: crudServiceBaseUrl + "/Products",
dataType: "jsonp"
},
update: {
url: crudServiceBaseUrl + "/Products/Update",
dataType: "jsonp"
},
destroy: {
url: crudServiceBaseUrl + "/Products/Destroy",
dataType: "jsonp"
},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
parse: function (data) {
for (var i = 0; i < data.length; i++) {
data[i].letter = data[i].complex_name.charAt(0);
}
return data;
},
model: {
id: "ProductID",
fields: {
ProductID: { editable: false, nullable: true },
ProductName: "ProductName",
UnitPrice: { type: "number" },
Discontinued: { type: "boolean" }
}
}
},
group: { field: "letter" } //enabling grouping breaks the
clicking on a complex and sends a uid of undefined to detail view
});
My modification is this:
No comments:
Post a Comment