PDA

View Full Version : How to start download file from ExtGrid tab button?



softm
27 Jan 2011, 2:31 PM
I try this way:

1. I make an link <a href="./text.zip">get</a>
2. Add this button in tab of

Ext.grid.EditorGridPanel (

3 this way:

{
text: 'Export records',
iconCls: 'icon-save',
handler : function(){

$("#export").click();

}

}

But this does not work for me. Pls help me - to initialise dosnload of xxxx file from tab button.

Thank your.

steffenk
27 Jan 2011, 3:36 PM
jquery?

simple example, check it in console


new Ext.Button ({
text: 'download',
renderTo: Ext.getBody(),
handler: function() {
window.open(path-to-text.zip);
}
});

softm
27 Jan 2011, 4:32 PM
i try to do this with jquery, yes.
Made already fancybox with link :)
Thank your for answer.
It works :)


{
/* + One more check*/

text: 'Export to Excell 2007',
iconCls: 'icon-save',
renderTo: Ext.getBody(),
handler: function() {
window.open('{/literal}{$config_site_url}/admin.php?act=download{literal}');
}


}

Thsnkx,
73!