Dear,
In 'beforeSave' I set args.needBlobData = true and args.isFullPost = false to get the blob data in 'saveComplete' to process blob in server side code.
When I run my code and when I choose 'File > save as > Microsoft Excel' in the Spreadsheet menu I get below 'save-as' dialog / prompt to enter a filename.
How can I hide this prompt? (as I don't want to enter filename)
Thx
Frederik
Hi Frederik,
Your requirement can be achieved using dialogBeforeOpen event. We have prepared a sample that meets out your requirement and attached below for reference.
CODE BLOCK:
|
dialogBeforeOpen(args) { if(args.dialogName === "Save As"){ args.cancel = true; } } |
Stackblitz Sample: https://stackblitz.com/edit/eb2gl9?file=index.ts
Get back to us if you need any other further assistance regarding.
Thx for he reply.
args.cancel = true; stops the save operation which is not what I wanted to happen.
I could achieve what I want by creating a new button in the ribbon.
Another question related to customizing the ribbon:
when I create a new ribbon before 'Home'
and run the code, the selected ribbon is 'new tab' but the content of the new tab is the content of the Home tab.
When i click Home tab:
When i click 'new tab'
How can I resolve this and immediatly see the contents of the last screenshot when I run the Spreadsheet contro?
Thx
Frederik
Hi Frederik,
Your requirement can be achievable by setting the selectedItem property as shown below for spreadsheet ribbon tab.
|
created: (): void => { //Applies cell and number formatting to specified range of the active sheet spreadsheet.cellFormat( { fontWeight: 'bold', textAlign: 'center', verticalAlign: 'middle' }, 'A1:F1' ); spreadsheet.numberFormat('$#,##0.00', 'F2:F31'); spreadsheet.addRibbonTabs( [ { header: { text: 'New Tab' }, content: [{ text: 'opslaan2', tooltipText: 'Excel opslaan2' }], }, ], 'Home' ); document.getElementsByClassName( 'e-tab' )[0].ej2_instances[0].selectedItem = 3; setTimeout(() => { document.getElementsByClassName( 'e-tab' )[0].ej2_instances[0].selectedItem = 1; }, 10);
}, |
For your convenience, we have prepared the sample based on our suggestion. Please find the link below.
Sample Link : https://stackblitz.com/edit/eb2gl9-te6qtn?file=index.ts
It works, thanks a lot!
Rgds
Frederik
Hi Frederik,
We are happy to hear that your issue has been resolved, please get back to us if you need any further assistance on this.