Access action Button

2 posts, 0 answers
  1. Katyusca
    Katyusca avatar
    5 posts
    Member since:
    Apr 2009

    Posted 24 Aug 2009 Link to this post

    Hi,
    I want throw in any moment the event of button in fileexplorer, and not only pressing the button

    How  can i do that'??

    Thanks
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 27 Aug 2009 Link to this post

    Hi Katyusca,

    This can be achieved by getting the reference to the RadToolBar and then use its client-side API. The code bellow shows the steps to run the Upload command from JavaScript. The commented parts also work and you could use the same approach for the other commands in the Explorer.

    <script type="text/javascript"
        function runCommand() 
        { 
            var oExplorer = $find("<%= RadFileExplorer1.ClientID %>"); 
            var oToolbar = oExplorer.get_toolbar(); // Get the toolbar 
     
            // Upload button ; 
            var oUpButton = oToolbar.findItemByValue("Upload"); 
            oUpItem.click(); 
     
            // delete command ; 
            // var oDelButton = oToolbar.findItemByValue("Delete"); 
            // oDelButton.click(); 
     
            // Refresh command ; 
            // var oRefreshButton = oToolbar.findItemByValue("Refresh"); 
            // oRefreshButton.click(); 
            // Instead you could use the oExplorer.refresh(); as well ; 
        } 
    </script> 
     
    I hope this helps.

    Greetings,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top