File Explorer - Refresh function

16 posts, 0 answers
  1. Jeroen Speldekamp
    Jeroen Speldekamp avatar
    30 posts
    Member since:
    Mar 2005

    Posted 04 Jun 2009 Link to this post

    Hello,

    In the picture down here you see an image of the FileExplorer wich has an option to unzip zip files.
    http://i43.tinypic.com/wsqw79.jpg


    Now my questions are

    1. Is it possible to call up the refresh screen before the unzipping process starts. (Because then people know the program is busy unzipping)
    http://i44.tinypic.com/iyzfog.jpg

    2. And after every thing is unzipped i'd like to execute the refresh command like the refresh button in the toolbar. Is it a code which I can access ?. I had found the code for the refreshment of the grid ".Rebin()" but for the treeview there is no such method. So if its possible to use the code which is called by the refresh button in the toolbar it will be perfect.

    Thanks in advance,
    Jeroen Speldekamp
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 05 Jun 2009 Link to this post

    Hi Jeroen,

    1. You can get a reference to the ajax loading panel we use in the file explorer control and show/hide it on the client. For example:

    function loadingPanel(explorer, toShow) 
        var loadingPanel = explorer.get_ajaxLoadingPanel(); 
        if (true == toShow) 
        { 
            loadingPanel.show(explorer.get_id()); 
        } 
        else 
        { 
            loadingPanel.hide(explorer.get_id()); 
        } 
     

    The above function will show or hide a loading panel over the file explorer control. Here is how you can call it from your code:

    var explorer = $find("<%= RadFileExplorer1.ClientID %>"); 
    ... 
     
    //to show the loading panel 
    loadingPanel(explorer, true); 
    ...
    //to hide the loading panel 
    loadingPanel(explorer, false); 
     

    2. To refresh the file explorer after you have unzipped the file on the server, simply call its .refresh() client API method. It is not possible to update the file explorer during your first Ajax request, because the tree/grid controls are not updated then and the changes will not be sent back to the browser.

    Sincerely yours,
    Lini
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeroen Speldekamp
    Jeroen Speldekamp avatar
    30 posts
    Member since:
    Mar 2005

    Posted 08 Jun 2009 Link to this post

    Hello, Lini

    Ok figuered it out a bit but still got bit problems with it.
    I'll open a support ticket so i can attach a project to it.

    Thanks,
    Jeroen Speldekamp
  5. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 18 Jun 2009 Link to this post

    Hi Jeroen,

    Would you care to give me some hints how to implement the custom context menu for the UNZIP option in the FileExplorer.

    I am struggling with this for some time now, I have the UNZIP script running but don't know how to get it in the Contextmenu...

    I would greatly appreciate your help.

    Regards,
    Marc
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 18 Jun 2009 Link to this post

    Hello Fit2Page,

    I believe that this KB article will be of help.

    Greetings,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 18 Jun 2009 Link to this post

    Hi Fiko,

     

    I have read the KB and I am sure this will do the job.

    Thanks for giving the pointer.

     

    BR,

    Marc

  8. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 18 Jun 2009 Link to this post

    Hi Fiko,

    I am now working on the integration of the UnZip button in FileBrowser.ascx

    This page doesn't seem to run the Page_Load routine, do you have a clue?

    Your demo file runs fine by the way.

    BR,
    Marc
  9. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 18 Jun 2009 Link to this post

    Hi Lini,

    I am also trying to refresh the FileExplorer after unzipping with the following piece of code:

    <script type="text/javascript">  
                    function OnGridContextItemClicked(oGridMenu, args)  
                    {  
                        var menuItemText = args.get_item().get_text();  
                        if (menuItemText == "UnZip")  
                        {// 'UnZip' command  
                            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>");  
                            var oAjaxPanel = $find("<%= RadAjaxPanel1.ClientID %>");  
     
                            var selectedItem = oExplorer.get_selectedItem();  
                            if (selectedItem.get_extension()=="zip")  
                            {  
                            //var itemExt = ; // get the extension of the current item  
     
                                var itemPath = selectedItem.get_path(); // get the path of the current item  
                                oAjaxPanel.ajaxRequest(itemPath); // Call the RadAjaxPanel1_AjaxRequest function on the server ;  
                                  
                                //hier refreshen  
                                oExplorer.refresh();  
                            }  
                            else 
                            {  
                                alert("Please, select a ZIP file");  
                            }  
                        }  
                    }  
                </script> 
    The refresh function is not working.

    FF (firebug) gives me:[Exception... "'Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame ::


    IE (Fiddler) gives me nothing. The loading image is visible but nothing happens.

    Thanks in advance for your help.

    Marc
  10. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 19 Jun 2009 Link to this post

    Hello Fit2Page,

    We are sorry but we cannot reproduce the scenario on our side. We are much willing to help, but we will need your further cooperation. Could you, please, send us a simple running application which demonstrates your scenario and reproduces the problems you experience. We will take a closer look at your code, test it on our side, investigate the issues and do our best to help you.

    Regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 22 Jun 2009 Link to this post

    Hi Fiko,

    I created the test site ZIP for reproduction. Where can I send it?

    BR,
    Marc
  12. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 22 Jun 2009 Link to this post

    Hello Fit2Page,

    You need to open a new support ticket and then you will be able to attach files to that thread.

    Regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  13. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 22 Jun 2009 Link to this post

    OK Fiko,

    Done this. Your ticket ID is : 221420

    BR,
    Marc
  14. Corey
    Corey avatar
    9 posts
    Member since:
    Mar 2012

    Posted 26 Mar 2012 Link to this post

    Jeroen Speldekamp. I have a question about your unzip function.  How did you get it to work. I have basically the same function as you do in javascript what am i missing from the code. Thanks in advance
  15. Corey
    Corey avatar
    9 posts
    Member since:
    Mar 2012

    Posted 26 Mar 2012 Link to this post


  16. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 27 Mar 2012 Link to this post

    Hi Corey,

    Do you have SharpZipLib installed to unzip on the server?

    Marc
  17. Qwicksoft
    Qwicksoft avatar
    10 posts
    Member since:
    Dec 2013

    Posted 16 Jun 2014 in reply to Fit2Page Link to this post

    Hi,

           How to file explorer in Word document,pdf.in asp.net rad control
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017