or
<!--Main view-->
<
div
data-role
=
"view"
data-init
=
"mobileListViewDataBindInitFlat"
data-title
=
"ClickView 24/7 Alerts"
id
=
"mainView"
>
<
ul
data-role
=
"listview"
data-style
=
"inset"
data-type
=
"group"
id
=
"result"
></
ul
>
</
div
>
<!--Alerts Display view -->
<
div
data-role
=
"view"
id
=
"displayPage"
data-title
=
"ClickView 24/7 Alerts"
data-init
=
"mobileListViewint"
>
<
ul
data-role
=
"listview"
id
=
"datashow"
>
</
ul
>
</
div
>
<!--main layout-->
<
div
id
=
"layout"
data-role
=
"layout"
data-id
=
"main-layout"
>
<
div
data-role
=
"header"
>
<
div
data-role
=
"navbar"
>
<
span
data-role
=
"view-title"
></
span
>
</
div
>
</
div
>
<
div
data-role
=
"footer"
>
<
div
data-role
=
"tabstrip"
>
<
a
href
=
"#mainView"
data-icon
=
"home"
>Home</
a
>
<
a
href
=
"#alertPage"
data-icon
=
"favorites"
>Alerts</
a
>
</
div
>
</
div
>
</
div
>
<!-- Main Listview Template-->
<
script
type
=
"text/x-kendo-template"
id
=
"showtemp"
>
<
a
class
=
"show"
href
=
"\#displayPage"
data-show
=
"${ProgramId}"
>
<
span
class
=
"date"
>${Start}</
span
>
<
h2
>${Title}</
h2
>
<
h3
class
=
"chan"
>${Channel}</
h3
>
<
p
class
=
"descript"
>${Description}</
p
>
</
a
>
</
script
>
<!-- Alerts Listview Template-->
<
script
type
=
"text/x-kendo-template"
id
=
"datatemp"
>
<
h3
class
=
"keyword"
>Keyword: #: Keyword#</
h3
>
<
a
class
=
"actionbutton"
data-role
=
"detailbutton"
data-style
=
"contactadd"
></
a
>
<
p
class
=
"subtime"
>#: SubTime#</
p
>
<
p
class
=
"subtext"
>#: SubText#</
p
>
</
script
>
<
script
>
window.app = new kendo.mobile.Application(document.body,{transition: "slide", layout: "main-layout"});
//Main ListView initialiser
var showDataSource = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost:3146/api/shows/wilan.bigay@clickview.com.au",
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
data: {
q: "javascript"
}
}
}
});
function mobileListViewDataBindInitFlat() {
$("#result").kendoMobileListView({
dataSource: showDataSource,
template: $("#showtemp").text(),
})
}
$('.show').live('click',function(){
var progID = $(this).attr('data-show');
var dataURL = 'http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/' + progID
});
//Alerts ListView
var dataDataSource = new kendo.data.DataSource({
transport: {
read: {
url: dataURL , //"http://localhost:3146/api/shows/wilan.bigay@clickview.com.au/data/0000000",<- how it should look like taking the 'data-show' attribute at the end of the URL
dataType: "jsonp",
contentType: "application/json; charset=utf-8",
data: {
q: "javascript"
}
}
}
});
function mobileListViewint() {
$("#datashow").kendoMobileListView({
dataSource: dataDataSource,
click: function(e) {
//dataURL = e.dataItem.data-show;
console.log(e.dataItem.title);
},
template: $("#datatemp").text(),
})
}
</
script
>
<
script
>
$("#treeview-left, #treeview-right").kendoTreeView({
dragAndDrop: true,
dataSource: [
{ text: "Item 1", expanded: true, items: [
{ text: "Item 1.1" },
{ text: "Item 1.2" },
{ text: "Item 1.3" }
] },
{ text: "Item 2", items: [
{ text: "Item 2.1" },
{ text: "Item 2.2" },
{ text: "Item 2.3" }
] },
{ text: "Item 3" }
]
}).data("kendoTreeView");
</
script
>
<
script
>
$("#treeview-left, #treeview-right").kendoTreeView({
dragAndDrop: true,
dataSource: {
transport: {
read: {
url: "/site/GetTreeData.action",
dataType: "json"
}
}
}
}).data("kendoTreeView");
</
script
>
[
{ text: "Item 1", expanded: true, items: [
{ text: "<
a
href
=
'http://localhost:8080/site/GetEmployee.action'
>clear here</
a
>", encoded: false },
{ text: "Item 1.2" },
{ text: "Item 1.3" }
] },
{ text: "Item 2", items: [
{ text: "Item 2.1", items: [
{ text: "Item 2.1.1" },
{ text: "Item 2.1.2" }
] },
{ text: "Item 2.2" },
{ text: "Item 2.3" }
] },
{ text: "Item 3" }
]
If I paste the previous JSON string inside the page and reload it, the tree displays just fine.
So, what am I doing wrong?
<
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
>
<?
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
>
<
ul
data-role
=
"actionsheet"
id
=
"inboxActions"
data-open
=
"onOpen"
data-popup
=
'{"direction": "left"}'
>
<
li
class
=
"km-actionsheet-title"
>Monday Meeting:</
li
>
<
li
><
a
href
=
"#"
data-action
=
"reply"
>Reply</
a
></
li
>
<
li
><
a
href
=
"#"
data-action
=
"replyAll"
>Reply All</
a
></
li
>
<
li
><
a
href
=
"#"
data-action
=
"archive"
>Archive</
a
></
li
>
</
ul
>
<
ul
data-role
=
"actionsheet"
id
=
"inboxActions"
data-open
=
"onOpen"
data-popup
=
'{"direction": "left"}'
>
<
li
class
=
"km-actionsheet-title"
>Monday Meeting:</
li
>
<
li
><
a
href
=
"#"
data-action
=
"singleEventHandler"
>Reply</
a
></
li
>
<
li
><
a
href
=
"#"
data-action
=
"singleEventHandler"
>Reply All</
a
></
li
>
<
li
><
a
href
=
"#"
data-action
=
"singleEventHandler"
>Archive</
a
></
li
>
</
ul
>
function singleEventHandler(e) {
if (<
some
test involving e>) {
$("#actionResult").html("Replying to message #" + e.context);
} else if (<
some
other test involving e>) {
$("#actionResult").html("Replying to all in message #" + e.context);
} else if (<
some
other test involving e>) {
$("#actionResult").html("Archiving message #" + e.context);
}
doMoreStuff();
}
columns.Bound(p => p.URL).Title("Url").Visible(false);
columns.Template(p => p.TRACKINGNUMBER).ClientTemplate(
"<
a
href
=
'#= URL #'
>#= TRACKINGNUMBER #</
a
>"
).Title("Tracking Number");
<
li
data-bind
=
"invisible: #= console.log(this) #"
>
<
span
>test</
span
>
</
li
>
Fires when the drop-down list has received data from the data source.
$("#dropdownlist").kendoDropDownList({
dataBound: function(e) {
// handle event
}
});
// get a reference to the dropdown list
var dropdownlist = $("#dropdownlist").data("kendoDropDownList");
// bind to the close event
dropdownlist.bind("dataBound", function(e) {
// handle event
});