PDA

View Full Version : How to start an automatic file download after a dblclick event on a button?



Elfayer
31 Aug 2012, 2:33 AM
Hi,

I'm trying to download a file after a double click event on a button. So I catched the event:

button.el.on('dblclick', function (cmp) { });

But I don't know how to start an html script automaticly.
I don't want to pass by a text link like:

button.el.on('dblclick', function (cmp) {
var win = Ext.create('Ext.window.Window', {
title: 'Document',
width: 80,
height: 50,
html: '<a href="' + [THE PATH] + '">Click Here</a>'
}).show();
});

Thanks in advance !

Farish
31 Aug 2012, 2:39 AM
inside your double click listener, you can do:


var url = 'your_file_url';
window.open(url);

where window.open is standard javascript (not ExtJS specific)