Hi Admin and everybody,
As title above, I using datasource to read data (url string) for Kendo Image Editor.
But when read new data with the same name (name = url string), it only retrieves the original preloaded images. But It runs normally when I open F12 and check to "disable cache" (image will show you)
Easier to understand, when starting to reload the page, the cache is empty, I load an image url string, it will show the image (Come here, run very well).
Then My Json read another image (it's a different picture) have the same name (name = url string) as the original image. It still shows the original image.
When I "F12" open DevTools then Network and check "Disable cache" (i understand it is not save cache), every time I run it, it's normal. It will show true/new image have the same name as the original image
What happend in my code.???
My code will show you :
var dataSourceGetImageUrlWithDrawing = new kendo.data.DataSource({
autoSync: true,
transport: {
read: function (options) {
$.ajax({
url: "/_layouts/xyz/getimageurl, //my link API
type: 'GET',
cache: false,
scriptCharset: "utf8",
dataType: "json",
data: {
models: kendo.stringify(options.data.models)
},
success: function (result) {
options.success(result);
}
});
},
},
schema: {
data: 'data',
model: {
id: "imageUrlWithDrawing"
}
},
change: function (e) {
var view = dataSourceGetImageUrlWithDrawing.view()[0].imageUrlWithDrawing; //url in json data
$("#imageEditorWithDrawing").kendoImageEditor({
imageUrl: view,
width: "100%",
height: 650,
saveAs: {
fileName: "image_edited.png"
}
});
var imageEditorWithDrawing = $("#imageEditorWithDrawing").getKendoImageEditor();
imageEditorWithDrawing.one("imageRendered", function () {
imageEditorWithDrawing.executeCommand({ command: "ZoomImageEditorCommand", options: imageEditorWithDrawing.getZoomLevel() - 0.2 });
});
}
});