PDA

View Full Version : How to Ext.ajax.request set target



penot
13 Jul 2012, 9:20 PM
Hello,

I JSON Data request use Ext.ajax.request

Then responce Data is PDF Data I want show new Window

How to set target ?

My Code


Ext.Ajax.request({
url: requestUrl,
method: 'POST',
jsonData : {
printData : this.up('gridpanel').getStore().getProxy().data
},
success: function(data) {
window.open('data:application/pdf,'+escape(data),
'Batch Print',
'width=600,height=600,location=_newtab'
);
},
failure: function() {
}
});

scottmartin
13 Jul 2012, 9:31 PM
Have a look at the following:
http://www.w3schools.com/jsref/met_win_open.asp

Scott.

sword-it
13 Jul 2012, 9:37 PM
HI!

you may try this:-




window.open(yourHref,'resizable,scrollbars');



This opens the link address in a new, re sizable window with scrollbars.

for more info, check out the following links:-

http://www.codeproject.com/Articles/19871/Opening-PDFs-in-a-new-window-with-JavaScript