3 Answers, 1 is accepted
0
Hello Jack,
You are correct, folders can be created only if the UploadPaths property is correctly set. The logic for file uploading and folder creation needs the same configuration and currently I cannot suggest a proper approach to allow only the folder creation.
Nevertheless, I believe that removing the HTML button should fit your expectation, this can be done with a simple custom implementation that gets the element and removes it from the DOM:
Regards,
Ianko
Telerik
You are correct, folders can be created only if the UploadPaths property is correctly set. The logic for file uploading and folder creation needs the same configuration and currently I cannot suggest a proper approach to allow only the folder creation.
Nevertheless, I believe that removing the HTML button should fit your expectation, this can be done with a simple custom implementation that gets the element and removes it from the DOM:
<
telerik:RadEditor
runat
=
"server"
ID
=
"RadEditor1"
OnClientCommandExecuted
=
"OnClientCommandExecuted"
>
<
TemplateManager
ViewPaths
=
"~/Folder"
UploadPaths
=
"~/Folder
"
/>
</
telerik:RadEditor
>
<
script
type
=
"text/javascript"
>
function OnClientCommandExecuted(editor, args) {
var command = args.get_commandName();
if (command === "TemplateManager") { // You should check for all desired file browser dialogs
var dialog = editor.get_dialogOpener()._dialogContainers[command];
dialog.add_pageLoad(function () {
var oDoc = dialog.get_contentFrame().contentDocument;
$telerik.$(oDoc).find(".icnUpload").remove();
})
}
}
</
script
>
Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Jon
Top achievements
Rank 1
answered on 26 Feb 2014, 01:03 PM
Hi Ianko,
Yes that works great - Thank you!
Jack
Yes that works great - Thank you!
Jack
0
Accepted
Hi Jon,
After some further investigation I found that the users will be able to upload files through the context menus.
You can refer to this updated example:
Regards,
Ianko
Telerik
After some further investigation I found that the users will be able to upload files through the context menus.
You can refer to this updated example:
<
telerik:RadEditor
runat
=
"server"
ID
=
"RadEditor1"
OnClientCommandExecuted
=
"OnClientCommandExecuted"
>
<
TemplateManager
ViewPaths
=
"~/Paths"
UploadPaths
=
"~/Paths"
/>
</
telerik:RadEditor
>
<
script
type
=
"text/javascript"
>
function OnClientCommandExecuted(editor, args) {
var command = args.get_commandName();
if (command === "TemplateManager") { // You should check for all desired file browser dialogs
var dialog = editor.get_dialogOpener()._dialogContainers[command];
dialog.add_pageLoad(function () {
var oDoc = dialog.get_contentFrame().contentDocument;
var oWin = dialog.get_contentFrame().contentWindow;
var fileExplorerID = oDoc.getElementsByClassName("RadFileExplorer")[0].id;
var feControl = oWin.$find(fileExplorerID);
// Get context upload button
var gridContextUpload = feControl.get_gridContextMenu().findItemByText("Upload");
var gridContextItems = feControl.get_gridContextMenu().get_items();
// Get tree upload button
var treeContextUpload = feControl.get_tree().get_contextMenus()[0].findItemByText("Upload");
var treeContextItems = feControl.get_tree().get_contextMenus()[0].get_items();
gridContextItems.remove(gridContextUpload);
treeContextItems.remove(treeContextUpload);
$telerik.$(oDoc).find(".icnUpload").remove();
})
}
}
</
script
>
Regards,
Ianko
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.