Hi Matt,
Greetings from Syncfusion support.
Yes, you can add a custom button in both Toolbar and Context Menu of
the File Manager component. The toolbar items can be
customized using the toolbarSettings API and toolbarClick events.
The context menu can be customized using the contextMenuSettings, menuOpen, and menuClick events.
You can refer to the below documentation to achieve
this requirement.
https://ej2.syncfusion.com/angular/documentation/file-manager/how-to/adding-custom-item-to-toolbar/
https://ej2.syncfusion.com/angular/documentation/file-manager/how-to/adding-custom-item-to-context-menu/
You can retrieve the path value inside the File Manager within the
toolbarClick and menuClick as shown below.
|
toolbarClick(args) {
if (args.item.text === 'Custom') {
var fullPath = this.fileObj.path + this.fileObj.selectedItems;
alert('You have clicked custom toolbar item and path is
' + fullPath
+ '.');
}
}
menuClick(args) {
if (args.item.text === 'Custom') {
var fullPath = this.fileObj.path + this.fileObj.selectedItems;
alert('You have clicked custom menu item and path is ' + fullPath + '.');
}
}
|
Sample: https://stackblitz.com/edit/react-whqvv9?file=index.js,index.css,index.html
We would also like to share that we have prepared a sample to open
the following extension file (pdf, docx, xlsx, txt) in the File Manager by using
PDF Viewer, DocumentEditor and SpreadSheet components. You
can refer to the below link to achieve the same.
https://www.syncfusion.com/forums/154689/how-to-integrate-pdfviewer-to-preview-pdf-files-on-the-file-explorer-component?reply=NqZPuM
Please check the shared details and get back to us if you need any
further assistance.
Regards,
Indhumathy L