Our Editor, with ImageBrowser, code is like so:
Everything is working great, except when I click on a Directory in the ImageBrowser and click the Delete button. When I click the Delete button, the alert pops up asking if I want to delete the directory . When I click OK, the directory disappears from the ImageBrowser, but a call to the server is never made. No errors appear in the console of Developer Tools in Chrome 34 or IE11.
I should note that deleting individual images works fine. It's only deleting directories that doesn't currently work.
I notice that the demo on demos.telerik.com does work with deleting directories, so it has got to be a problem with our code. But what from my code above could be causing this issue? Why are no errors appearing in the console? Any tips, advice, or thoughts of possible things that could be wrong are appreciated. Thank you for your time.
$(
"#Html"
).kendoEditor({
encoded:
false
,
imageBrowser: {
schema: {
model: {
id:
"EntFileId"
,
fields: {
name:
"name"
,
type:
"type"
,
size:
"size"
,
EntFileId:
"EntFileId"
}
}
},
transport: {
read:
"@Url.Action("
Index
", "
EditorImageBrowser
", new { area = "
" })"
,
destroy: {
url:
"@Url.Action("
Delete
", "
EditorImageBrowser
", new { area = "
" })"
,
type:
"POST"
},
create: {
url:
"@Url.Action("
Create
", "
EditorImageBrowser
", new { area = "
" })"
,
type:
"POST"
},
thumbnailUrl:
function
(path, name) {
var
entFileId =
""
;
var
data = $(
".k-imagebrowser"
).data(
"kendoImageBrowser"
).dataSource.data();
$.each(data,
function
(key, obj) {
if
(obj.name == decodeURI(name))
entFileId = obj.EntFileId;
});
var
ext = name.substring(name.lastIndexOf(
"."
));
var
url =
"@Model.BlobPath"
+ entFileId +
"/thumb"
+ ext;
return
url;
},
uploadUrl:
"@Url.Action("
Upload
", "
EditorImageBrowser
", new { area = "
" })"
,
imageUrl:
function
(name) {
//get only filename
if
(name.indexOf(
'/'
) !== -1) {
name = name.substring((name.lastIndexOf(
"/"
) + 1));
}
var
entFileId =
""
;
var
data = $(
".k-imagebrowser"
).data(
"kendoImageBrowser"
).dataSource.data();
$.each(data,
function
(key, obj) {
if
(obj.name == decodeURI(name))
entFileId = obj.EntFileId;
});
var
url =
"@Model.BlobPath"
+ entFileId +
"/"
+ name;
return
url;
}
}
},
tools: [
"clear"
,
"bold"
,
"italic"
,
"underline"
,
"strikethrough"
,
"justifyleft"
,
"justifycenter"
,
"justifyRight"
,
"justifyFull"
,
"insertUnorderedList"
,
"insertOrderedList"
,
"indent"
,
"outdent"
,
"createLink"
,
"unlink"
,
"insertImage"
,
"createTable"
,
"addColumnLeft"
,
"addColumnRight"
,
"addRowAbove"
,
"addRowBelow"
,
"deleteRow"
,
"deleteColumn"
,
"viewHtml"
,
"formatting"
,
"fontName"
,
"fontSize"
,
"foreColor"
,
"backColor"
]
});
Everything is working great, except when I click on a Directory in the ImageBrowser and click the Delete button. When I click the Delete button, the alert pops up asking if I want to delete the directory . When I click OK, the directory disappears from the ImageBrowser, but a call to the server is never made. No errors appear in the console of Developer Tools in Chrome 34 or IE11.
I should note that deleting individual images works fine. It's only deleting directories that doesn't currently work.
I notice that the demo on demos.telerik.com does work with deleting directories, so it has got to be a problem with our code. But what from my code above could be causing this issue? Why are no errors appearing in the console? Any tips, advice, or thoughts of possible things that could be wrong are appreciated. Thank you for your time.