Approved
Last Updated: 27 Jul 2016 10:10 by DavidS
ADMIN
Danail Vasilev
Created on: 25 Jul 2016 16:34
Category: FileExplorer
Type: Bug Report
2
Delete multiple files with context menu from FileExplorer (ExplorerMode="FileTree")
For the time being the following workaround can be used:
		<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Width="230px" Height="430px" DisplayUpFolderItem="true"
			ExplorerMode="FileTree">
		</telerik:RadFileExplorer>
		<script>
			Telerik.Web.UI.RadFileExplorer.prototype._onTreeContextMenuItemClicked = function (sender, args) {
				var treeNode = args.get_node();
				var menuItem = args.get_menuItem().get_value();
				switch (menuItem) {
					case "Rename":
						treeNode.startEdit();
						var nodeInput = treeNode.get_inputElement();
						if (!this._allowFileExtensionRename) {
							var item = this._createItemFromTreeViewNode(treeNode);
							if (!item.isDirectory())
								nodeInput.value = $T.FileExplorerHelper.stripExtension(item);
						}
						this._attachFileNameValidator(nodeInput);
						var treeUL = sender.get_childListElement();
						this._treeKeyDownDelegate = Function.createDelegate(this, this._treeKeyDown);
						if (treeUL) $telerik.addHandler(treeUL, "keydown", this._treeKeyDownDelegate, true);
						break;
					case "NewFolder":
						if (!this._isNodeADirectory(treeNode)) {
							treeNode = treeNode.get_parent();
						}
						var nodeValue = treeNode.get_value();
						this.createNewDirectory(nodeValue);
						break;
					case "Delete":
						var selItems = sender.get_selectedNodes();
						var delItem = new Array();
						for (var i = 0; i < selItems.length; i++) {
							var currItem = this._createItemFromTreeViewNode(selItems[i]);
							delItem.push(currItem);
						}
						this.deleteItem(delItem);
						break;
					case "Upload":
						this._showUploadWindow();
						break;
					case "Copy":
						var selectedItem = null;
						if (!treeNode.get_selected()) {
							selectedItem = this._createItemFromTreeViewNode(treeNode);
						}
						this._copy("tree", selectedItem);
						break;
					case "Paste":
						var pasteItem = this._createItemFromTreeViewNode(treeNode);
						this._paste(pasteItem);
						break;
				}
			}
		</script>
1 comment
DavidS
Posted on: 27 Jul 2016 10:10
Bug is that when FileTree ExplorerMode is used , context menu/Delete will only delete last of a set of selected files.

I'm continually amazed at how ineffective your internal testing and narrow your definition of "normal usage" is.