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>7 Answers, 1 is accepted
I have looked at the code you have pasted, it seems that you have set the sort expression as property of the schema, instead of the dataSource. Please correct this and see if there is a change in the behavior you have described.
Regarding the error you have described, I suspect it is caused by an issue which we have already addressed and the fix will be available with the next official release. Meanwhile, I have attached a internal build for you to test.
Rosen
the Telerik team
If had the same problem with sorting, and have used the fix you attached.
There is still an other problem:
The dropdown items of the filter are empty when using XML data as source.
Regards,
Etienne
This is known issue which has been already addressed. The fix will be included in the next service pack of the library.
Regards,Rosen
the Telerik team
Unfortunately, I'm unable to recreate the described issue locally. Thus, it will be appreciated if you could provide a small sample in which it can be observed.
Regards,Rosen
the Telerik team