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!
You can override the handler for the save button in the toolbar by utilising the following pivot property:
beforetoolbarcreated
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() {
this.pivot.save({
filename: "myfile.json"
});
}
I've made a JSFiddle example: http://jsfiddle.net/odteu83q/7/
Just a follow up, within the customSaveFunction() you can have your code that prompts the user to enter their own filename.
Hello
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.
Regards,
Dmytro