This is a migrated thread and some comments may be shown as answers.

Remove Delete On Folders

1 Answer 52 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 14 Apr 2014, 02:02 PM
Is there a way to remove the ability to rename and delete of the folders?  I only want to give the users the ability to rename a delete files but the folders to be set and not allowed to modify.

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 17 Apr 2014, 01:45 PM
Hi Frank,

You can disable the delete/rename of folders by canceling the ClientDelete and ClientMove events in case the current item is a folder. For example, you can use a similar implementation:
<telerik:RadFileExplorer runat="server" ID="RadFileExplorer1" OnClientDelete="OnClientDelete" OnClientMove="OnClientMove">
</telerik:RadFileExplorer>
<script>
    function OnClientDelete(explorer, args) {
        var isFolder = args.get_item().isDirectory();
        if (isFolder) {
            args.set_cancel(true);
            alert("You do not have permissions to delete folders.");
        }
    }
    function OnClientMove(oExplorer, args) {
        var isRename = args.get_newPath().search("/") < 0;
        var isFolder = args.get_item().isDirectory();
        if (isRename && isFolder) {
            args.set_cancel(true);
            alert("You do not have permissions to rename folders.");
        }
    }
</script>

More detailed information regarding the FileExplorer's Client-side events can be found here: Client-side events. I hope this information will be helpful for you.

Regards,
Vessy
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
FileExplorer
Asked by
Frank
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or