Trigger a call to an API endpoint from a custom button on the toolbar

I have created a custom button on the toolbar of my FileManager control.  I have functions to handle the click and create events.  However I also want it to trigger a call to my API with extra information in the body of the request.  At the moment all it does is go into the click event handler but does not do anything else.

How can I achieve this?  Is it possible?

Regards 

James

1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team June 10, 2020 11:23 AM UTC

Hi James,  
 
We have checked your reported issue with FileManager component. You can add the custom item in toolbar using Toolbar settings. When clicking the toolbar item, toolbarClick event will trigger.  
 
Refer the below link: 
 
You can call your own API method using toolbarClick event. For your reference, we have prepared a simple sample to hit the controller method using ajax request. 
 
Refer the sample and service link below. 
 
 
 
By default, FileManager accept only the response from the default file operations of FileManager (Upload, Download, Read, Cut, Copy). If you create a custom method in controller and then pass the value to the FileManager component. FileManager component does not accept the value. Because, currently, we have not provided support to render FileManager content based on the given JSON data.  
 
We have already logged this as a feature from our end. It will be included in any one of our upcoming release. Generally, we will plan feature based on customer count, feature rank and whilist plan for some feature.  
 
Track the below link to know the feature status.  
 
 
We appreciate your patience.  
  
Refer the below link  to know more about the FileManager component.  
  
  
  
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon