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

Access action Button

1 Answer 62 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Katyusca
Top achievements
Rank 1
Katyusca asked on 24 Aug 2009, 06:51 PM
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

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 27 Aug 2009, 08:34 AM
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.
Tags
FileExplorer
Asked by
Katyusca
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or