Get Free Trial

Is it possible for me to define a name when saving the file?

Luciano Carvalho asked on February 20, 2018

When I click the Save button, it already saves it with the name “report.json”, is there any way to appear an input for the user to set this name before saving?
I wait, hugs!

3 answers

Psyala February 21, 2018

You can override the handler for the save button in the toolbar by utilising the following pivot property:


Then you can override the save tab’s handler with a function like so:

//inside function for beforetoolbarcreated:
let saveTab = tabs[2];
saveTab.handler = customSaveFunction;

//save function:
function customSaveFunction() {{
      filename: "myfile.json"

I’ve made a JSFiddle example:

Psyala February 21, 2018

Just a follow up, within the customSaveFunction() you can have your code that prompts the user to enter their own filename.

Dmytro Zvazhii Dmytro Zvazhii Flexmonster February 21, 2018

We are glad that the question seems to be resolved. Thank you for your participation Psyala. 
Luciano, please let us know if everything works fine for you.

Please login or Register to Submit Answer