This question is locked. New answers and comments are not allowed.
Hi, absolute beginner here, this is probably a silly question but I'm breaking my head here.
I've been trying to get the photo album interactive tutorial for the Telerik platform to work, and all is well up until step 3. In step 4 a function is added to add an image to a listview. I can get the button in the app, but it does not respond, i.e. no image is added to the listview (not in emulator, not on real phone which is a Windows phone).
Any hints? A link to where I can download the actual solution to the tutorial would also help a lot.
thanks! Andy
my app.js (probably where the error is):
(function () {
document.addEventListener("deviceready", function () {
window.listView = kendo.observable({
addImage: function () {
$("#images")
.data("kendoMobileListView")
.prepend(["images/08.jpg"]);
}
});
var app = new kendo.mobile.Application(document.body, {
skin: "flat"
});
$("#images").kendoMobileListView({
dataSource: ["images/01.jpg", "images/02.jpg", "images/03.jpg", "images/04.jpg", "images/05.jpg", "images/06.jpg", "images/07.jpg"],
template: "<img src='#: data #'>"
});
navigator.splashscreen.hide();
});
}());
and my index.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link href="kendo/styles/kendo.mobile.all.min.css" rel="stylesheet">
<link href="styles/main.css" rel="stylesheet">
<script src="cordova.js"></script>
<script src="kendo/js/jquery.min.js"></script>
<script src="kendo/js/kendo.mobile.min.js"></script>
<script src="scripts/app.js"></script>
</head>
<body>
<div data-role="view" data-model="listview" data-title="Photos">
<div data-role="navbar">
<span data-role="view-title"></span>
<button data-role="button" data-align="left" data-bind="click: addImage">Add</button>
</div>
<ul id="images"></ul>
</div>
</body>
</html>
I've been trying to get the photo album interactive tutorial for the Telerik platform to work, and all is well up until step 3. In step 4 a function is added to add an image to a listview. I can get the button in the app, but it does not respond, i.e. no image is added to the listview (not in emulator, not on real phone which is a Windows phone).
Any hints? A link to where I can download the actual solution to the tutorial would also help a lot.
thanks! Andy
my app.js (probably where the error is):
(function () {
document.addEventListener("deviceready", function () {
window.listView = kendo.observable({
addImage: function () {
$("#images")
.data("kendoMobileListView")
.prepend(["images/08.jpg"]);
}
});
var app = new kendo.mobile.Application(document.body, {
skin: "flat"
});
$("#images").kendoMobileListView({
dataSource: ["images/01.jpg", "images/02.jpg", "images/03.jpg", "images/04.jpg", "images/05.jpg", "images/06.jpg", "images/07.jpg"],
template: "<img src='#: data #'>"
});
navigator.splashscreen.hide();
});
}());
and my index.html:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<link href="kendo/styles/kendo.mobile.all.min.css" rel="stylesheet">
<link href="styles/main.css" rel="stylesheet">
<script src="cordova.js"></script>
<script src="kendo/js/jquery.min.js"></script>
<script src="kendo/js/kendo.mobile.min.js"></script>
<script src="scripts/app.js"></script>
</head>
<body>
<div data-role="view" data-model="listview" data-title="Photos">
<div data-role="navbar">
<span data-role="view-title"></span>
<button data-role="button" data-align="left" data-bind="click: addImage">Add</button>
</div>
<ul id="images"></ul>
</div>
</body>
</html>