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

Explorer copy/past problem

7 Answers 93 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
friendz 4u
Top achievements
Rank 1
friendz 4u asked on 13 Apr 2010, 01:33 PM
Hi,
I am using custom file content provider. Now I'm being able to do all other things on the context menu except the copy/paste.
Copy is working but when I'm pasting the file it is throwing a java script exception 'gridItem' not defined. Now Your script resource generating the follow code
_onGridMenuItemClicked:function(f,k){var m=k.get_item().get_value(); 
var n,c; 
var i=this._gridContextMenuSelectedItem; 
if(i){n=i.get_dataItem(); 
c=this._getGridDataItemPath(n); 
}switch(m){case"Rename":var o=n.Name; 
var h=this.get_localization()["Rename"]; 
function e(p){if(p){this._renameGridItem(c,p); 
}}var d=this
var g=this.get_windowManager(); 
window.setTimeout(function(){g.radprompt(h,Function.createDelegate(d,e),330,100,null,h,o); 
},10); 
break
case"Delete":this.deleteSelectedItems(); 
break
case"Open":var j=this._findItemByPath(c); 
this.open(j); 
break
case"NewFolder":this.createNewDirectory(this.get_currentDirectory()); 
break
case"Upload":this._showUploadWindow(); 
break
case"Copy":this._copy("grid"); 
break
case"Paste":var l=this._findItemByPath(c); 
if(l==null||!l.isDirectory()){gridItem=this._getCurrentFolderItem(); 
}this._paste(gridItem); 
break
}this._gridContextMenuSelectedItem=null
as in the paste section there is no way to get the gridItem if I'm pasting on a folder. Is it a bug or am i making some mistake.
Please let me know.
thanks
Arpan

7 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 16 Apr 2010, 09:35 AM
Hello Arpan,

The code you showed applies only when using the context menu in the Grid. There is a different function handling the context menu actions in the Tree. If there is an error on the line

this._paste(gridItem);

then the problem might be that the tree is not showing the current folder (the one that is displayed in the grid). I am not sure why this can happen. If you cannot reproduce the problem with the original content provider, then please review the docs we have about creating custom providers and check if you have missed something in your implementation - http://www.telerik.com/help/aspnet-ajax/radfileexplorer-custom-filebrowsercontentprovider.html

All the best,
Lini
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
friendz 4u
Top achievements
Rank 1
answered on 19 Apr 2010, 08:20 AM
Hi Lini,
Is it possible to copy a file from grid and paste it on a folder on the grid. And that is what I was doing when that exception occurred. And It is happening every time I try that. It is happening if I copy a folder too. I have given thought on checking out my Custom FileBrowserContentProvider. But in that case the Item command should fire but it is not firing because of the java script error. Now another thing I have blocked the right click so that the click works only on the grid row. Let know if there is any way out.
Thanks
Arpan
0
Lini
Telerik team
answered on 21 Apr 2010, 02:01 PM
Hello,

You first need to navigate to the new folder in the grid and then paste by right-clicking inside it. If you copy and try to paste before navigating to the new folder first, the file explorer will understand that as trying to paste in the same folder and will throw an error because the file already exists there. This is the behavior of the paste command in the RadFileExplorer (i.e. it does not respect the context of the item you right-clicked on and applies to the current folder).

In any case, I suspect the JavaScript problem also comes from your provider somehow. I tried the steps you listed in the current version and only received the "FileExists" alert message. No JavaScript message and the control made an Ajax request to the server.

Best wishes,
Lini
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Marco
Top achievements
Rank 1
answered on 28 Jul 2010, 11:30 AM
I found this code and trying to figure out the usefull bits for myself.
I like the idea of using a delegate to get the new name, I think the default rename does the same thing...
If I'm looking at the code there are a lot of functions I don't seem to have:
this._paste(gridItem); 
this._renameGridItem(c,p); 

How does this work? does anyone has an example?
0
Fiko
Telerik team
answered on 02 Aug 2010, 10:40 AM
Hi Marco,

I am not quite sure that I understood your requirements. Could you please provide me with more information about your configuration and the expected result? Also, could you please provide me with the information about the version of the Telerik.Web.UI.DLL file that you use?

All the best,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Marco
Top achievements
Rank 1
answered on 02 Aug 2010, 11:32 AM
I've upgraded to Telerik 2010 Q1
Since you can drag a file/directory from one location to another, thus moving the object,
I would like to know how I can change this behaviour to copy that object.
0
Marco
Top achievements
Rank 1
answered on 04 Aug 2010, 12:19 PM
As discussed in my thread the issue is resolved in the 2010 Q2 version
Tags
FileExplorer
Asked by
friendz 4u
Top achievements
Rank 1
Answers by
Lini
Telerik team
friendz 4u
Top achievements
Rank 1
Marco
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or