martinrame
29 Aug 2012, 7:47 AM
I need to send data to the server, who's response is a file, so I cannot handle it with the standard AJAX method.
So far, I can send GET requests by adding an "url" parameter to the button, and, in the controller's button handler, I simply do this:
onGetPDF: function(button){
var win = button.up('window');
lUrl = button.href;
Ext.getCmp('pdfBox').update( '<iframe src="' + lUrl + '">' );
}
As you can see, I've created an "Ext.Box" in my view, then I update its content with an iframe. This is working well, but now I need to do the same, but instead of sending a GET request I need to do a POST, because I have to send a lot of text to the server.
So far, I can send GET requests by adding an "url" parameter to the button, and, in the controller's button handler, I simply do this:
onGetPDF: function(button){
var win = button.up('window');
lUrl = button.href;
Ext.getCmp('pdfBox').update( '<iframe src="' + lUrl + '">' );
}
As you can see, I've created an "Ext.Box" in my view, then I update its content with an iframe. This is working well, but now I need to do the same, but instead of sending a GET request I need to do a POST, because I have to send a lot of text to the server.