How to customize or override Save As menu under File menu

I want to use my own custom javascript function when clicking Save As sub menu:
File
     Save As 
          Microsoft Excel
          Microsoft Excel 97-2003
          Comma-separated values  

So, I don't need to create my own button to do saving. I need some validation and the saving process should be ajax with custom response . How to achieve this? 

3 Replies 1 reply marked as answer

SP Sangeetha Priya Murugan Syncfusion Team December 31, 2020 08:04 AM UTC

Hi Moh, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported requirement and we would like to let you know that you can able to customize the file menu options by using the fileMenuSelect and fileMenuBeforeOpen events. For more details, please refer the below link. 
 
 
Could you please check the above details and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 


Marked as answer

RA Ramzi December 31, 2020 02:20 PM UTC

I have solved this issue. Anyway, to get it works I have to use developer options in chrome to find the IDs. Here the script I use.

function onFileMenuItemSelect(args) {
     if (args.item.properties.id == "spreadsheet_Xlsx") {
saveToServer();
     }
}

function onFileMenuBeforeOpen() {
     //this.hideFileMenuItems(['Save As', 'Open', 'New']);
     this.enableFileMenuItems([`${this.element.id}_New`], false, true);
     this.enableFileMenuItems([`${this.element.id}_Xls`], false, true);
     this.enableFileMenuItems([`${this.element.id}_Csv`], false, true);
}

Thank you


AS Aravinthan Seetharaman Syncfusion Team January 4, 2021 05:30 PM UTC

Hi Moh, 

Thanks for the update. 

We are happy to hear that your issue has been resolved. Please feel free to contact us, if you need any further assistance on this. 

Regards, 
Aravinthan S 


Loader.
Up arrow icon