Well, finally, I came to the following solution: firstly, we use the AJAX request to save the form details and create a PDF file on the server side.
success : function(form, action) {
var result = Ext.decode(action.response.responseText)
if (result.success) {
this.openForPrint(result.tmpFileName);
}
},
How do we use iframes to download and open a file?
openForPrint : function(fileSrc) {
Ext.DomHelper.append(document.body, {
tag : 'iframe',
name : 'printIframe',
src : this.getPrintPalletTagUrl()+'?userAction=actionPrint&tmpFileName='+fileSrc
});
}
This approach allows us to check whether the response is saved for operability and display a useful dialog for the user if the save fails.
source
share