Hello,
I've been reading the existing documentation about the Treeview as well as the Hierarchical Data Source and the Data Source but I kinda lost it about the possible remote data source types that I can use with the Treeview.
Apart from json,xml is also supported right?Is it possible to bind it and view the xml file with the Treeview?
I've been trying something like:
with the testTree.xml being:
but I can't seem to be able to view the tree at all..kinda lost here,can someone please point me to the right direction?
Thanks in advance
I've been reading the existing documentation about the Treeview as well as the Hierarchical Data Source and the Data Source but I kinda lost it about the possible remote data source types that I can use with the Treeview.
Apart from json,xml is also supported right?Is it possible to bind it and view the xml file with the Treeview?
I've been trying something like:
<
title
>Tree View</
title
>
<
link
href
=
"shared/styles/examples-offline.css"
rel
=
"stylesheet"
>
<
link
href
=
"styles/kendo.common.min.css"
rel
=
"stylesheet"
>
<
link
href
=
"styles/kendo.blueopal.min.css"
rel
=
"stylesheet"
>
<
script
src
=
"js/jquery.min.js"
></
script
>
<
script
src
=
"js/kendo.web.min.js"
></
script
>
<
script
src
=
"shared/js/console.js"
></
script
>
</
head
>
<
body
>
<
div
id
=
"example"
class
=
"k-content"
>
<
div
id
=
"treeview"
class
=
"demo-section"
></
div
>
<
script
>
var ds = new kendo.data.DataSource({
transport: {
read: {
url:"http://localhost:8080/OnTheSpotRestfullAPI/testTree.xml"
}
},
schema: {
type: "xml",
data: "/tree/vehicles",
model: {
fields: {
car: "car/text()",
bike: "bike/text()"
}
}
}
});
$("#treeview").kendoTreeView({
dataSource: ds
});
</
script
>
<
style
scoped>
#example {
text-align: center;
}
.demo-section {
display: inline-block;
vertical-align: top;
width: 320px;
height: 300px;
text-align: left;
margin: 0 2em;
}
</
style
>
</
div
>
</
body
>
</
html
>
with the testTree.xml being:
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
standalone
=
"yes"
?>
<
tree
>
<
vehicles
>
<
car
>FM-1100</
car
>
<
car
>FM-4200</
car
>
<
bike
>FM-3100</
bike
>
</
vehicles
>
<
personnel
>
<
client
>GH-3000</
client
>
<
vip
>GH-3100</
vip
>
</
personnel
>
</
tree
>
but I can't seem to be able to view the tree at all..kinda lost here,can someone please point me to the right direction?
Thanks in advance