Here is my test HTML page (only relevant to the problem):
and here is my XML file:
It doesn't work. I've also noticed if I overwrite the books.xml file in the sample line by line it will work. Other than that (which is stupid) I have no idea why the code refuses to run. The code is from the xml-data.html file.
Any ideas?
<
ul
id
=
"books"
></
ul
>
<
script
id
=
"template"
type
=
"text/x-kendo-template"
>
<
li
class
=
"book"
>
<
h3
>#= title #</
h3
>
by #= author #
</
li
>
</
script
>
<
script
>
$(document).ready(function() {
function onChage() {
$("#books").html(kendo.render(template, this.view()));
}
// create a template using the above definition
var template = kendo.template($("#template").html());
var dataSource = new kendo.data.DataSource({
transport: {
read: "filters.xml"
},
schema: {
// specify the the schema is XML
type: "xml",
data: "/Filters/Filter",
model: {
fields: {
title: "title/text()",
author: "@Id",
url: "info/text()"
}
}
},
change: onChage
});
dataSource.read();
});
</
script
>
and here is my XML file:
<?
xml
version
=
"1.0"
?>
-<
Filters
> -<
Filter
Id
=
"drwho"
> <
Collection
>drwho</
Collection
> <
Title
>Favourite Doctor</
Title
> <
Info
>link_to_popup_info.html</
Info
> <
Image
>drwho.png</
Image
> </
Filter
> -<
Filter
Id
=
"poo"
> <
Collection
>poop</
Collection
> <
Title
>smell that?</
Title
> <
Info
>link_to_popup_info.html</
Info
> <
Image
>poop.png</
Image
> </
Filter
> </
Filters
>
It doesn't work. I've also noticed if I overwrite the books.xml file in the sample line by line it will work. Other than that (which is stupid) I have no idea why the code refuses to run. The code is from the xml-data.html file.
Any ideas?