Hi Admins and everybody
I want to read imageUrl of Kendo ImageEditor using dataSource + TRANSPORT WITH FUNCTION
But It don't show. What wrong with my code. I have to image show json data in url
My code:
var dataSourceGetImageUrl = new kendo.data.DataSource({
transport: {
read: function (options) {
$.ajax({
url: "/api/handler.ashx?tbl=like&func=getimageurl",
type: 'GET',
cache: false,
scriptCharset: "utf8",
dataType: "json",
data: {
models: kendo.stringify(options.data.models)
},
success: function (result) {
options.success(result);
}
});
},
},
schema: {
data: 'data'
}
});
$("#imageEditor").kendoImageEditor({
dataSource: dataSourceGetImageUrl,
width: "100%",
height: 650,
saveAs: {
fileName: "image_edited.png"
}
});
var imageEditor = $("#imageEditor").getKendoImageEditor();
imageEditor.one("imageRendered", function () {
imageEditor.executeCommand({ command: "ZoomImageEditorCommand", options: imageEditor.getZoomLevel() - 0.2 });
});
What I need to fix it? Hope Admin and eeverybody help me. Thanks.
I solved my problem, I don't have method fetch(). it worked when I add more .fetch()