Approved
Last Updated: 05 Dec 2016 09:45 by ADMIN
ADMIN
Ianko
Created on: 05 Dec 2016 09:44
Category: FileExplorer
Type: Bug Report
0
OnClientMove is not raised when moving folder from Tree to Grid
Moving of folder from the tree to the grid works, but event is not raised. Also, there is no other suitable event that handles the situation. 

The following patch will raise the event, but  you should make sure to remove the override once the bug is fixed: 

<telerik:RadFileExplorer RenderMode="Lightweight" runat="server" ID="FileExplorer1" EnableCopy="true"
    OnClientMove="OnClientMove" OnItemCommand="FileExplorer1_ItemCommand" >
    <Configuration ViewPaths="~/Images" UploadPaths="~/Images"
        DeletePaths="~/Images"></Configuration>
</telerik:RadFileExplorer>     
 
<script>
    var origFunction = Telerik.Web.UI.RadFileExplorer.prototype._onTreeNodeDropping;
 
    Telerik.Web.UI.RadFileExplorer.prototype._onTreeNodeDropping = function (sender, args) {
        origFunction.call(this, sender, args);
        var destNode = args.get_destNode();
        if (!destNode) {
            var destElement = args.get_htmlElement();
            if (!destElement) return;
            var gridElement = this.get_grid();
            var grid = gridElement != null ? this._isOverElement(destElement, gridElement.get_id()) : null;
            if (grid) {
                var isCopying = this._enableCopy && args.get_domEvent().ctrlKey;
                var eventName = isCopying ? "copy" : "move";
                var args2 = new Telerik.Web.UI.FileExplorerEventArgs(this.get_tree().get_selectedNode(), this.get_currentDirectory());
                this.raiseEvent(eventName, args2);
            }
        }
    }
 
    function OnClientMove(sender, ev) {
        // Do something
    }
</script>
0 comments