Explorer copy/past problem

8 posts, 0 answers
  1. friendz 4u
    friendz 4u avatar
    4 posts
    Member since:
    Mar 2010

    Posted 13 Apr 2010 Link to this post

    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
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 16 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. friendz 4u
    friendz 4u avatar
    4 posts
    Member since:
    Mar 2010

    Posted 19 Apr 2010 Link to this post

    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
  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 21 Apr 2010 Link to this post

    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.
  6. Marco
    Marco avatar
    22 posts
    Member since:
    Jan 2009

    Posted 28 Jul 2010 Link to this post

    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?
  7. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 02 Aug 2010 Link to this post

    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
  8. Marco
    Marco avatar
    22 posts
    Member since:
    Jan 2009

    Posted 02 Aug 2010 Link to this post

    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.
  9. Marco
    Marco avatar
    22 posts
    Member since:
    Jan 2009

    Posted 04 Aug 2010 Link to this post

    As discussed in my thread the issue is resolved in the 2010 Q2 version
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017