I've reproduced a problem I'm seeing in my own application by modifying the Data Source > Binding to XML example to use a grid for rendering rather than a template, as shown in the code below. Except for specifying an original sort order, the data source is unchanged. I've configured the grid to allow grouping and sorting. However, whenever I attempt to either group or sort, I get
Error: Unable to get value of the property 'book': object is null or undefined
The debugger call stack indicates that the error is occurring in an "evaluate" method in kendo.data.xml.min.js. (I have the trial version, so can't inspect the source code further.)
Additionally, my original sort order is not being respected; the grid loads unsorted.
Are these bugs mine or the framework's?
<
div
id
=
"grid"
></
div
>
<
script
>
$(document).ready(function() {
var element = $("#grid").kendoGrid({
dataSource: {
transport: {
read: "books.xml"
},
schema: {
type: "xml",
data: "/books/book",
model: {
fields: {
title: "title/text()",
author: "author/text()",
url: "url/text()",
cover: "@cover"
}
},
sort: { field: "title", dir: "asc" }
}
},
columns: [ "title", "author", "url" ],
groupable: true,
sortable: {
mode: "single",
allowUnsort: false
}
});
});
</
script
>
Operator 'eq' incompatible with operand types 'System.Int32' and 'System.String' at position 5.