使用Telerik Platform時(shí)代碼不工作的問(wèn)題
發(fā)表于2019-05-10
回復(fù):0
查看:3527 |
我將代碼放進(jìn)去,但是它不工作
源代碼:telerik platform,使用相機(jī)添加圖片到庫(kù)中 有人能幫助我嗎?
<pre class='brush: js'>(function () {
document.addEventListener("deviceready", function () {
window.listView = kendo.observable({
addImage: function () {
var success = function (data) {
$("#images")
.data("kendoMobileListView")
.prepend(["data:image/jpeg;base64," + data]);
};
var error = function () {
navigator.notification.alert("Unfortunately we could not add the image");
};
var config = {
destinationType: Camera.DestinationType.DATA_URL,
targetHeight: 400,
targetWidth: 400
};
navigator.camera.getPicture(success, error, config);
}
});
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();
});
}());</pre>
登錄 慧都網(wǎng)發(fā)表評(píng)論