PDA

View Full Version : How to set a simple link with a button??



luc98
5 Jun 2007, 1:26 AM
Huh, to much Javascript ....
I don't know how to set a simple link for a button...

This is a button in a grid Header Panel.

{
text: 'Export to Excel',
handler : function(){
gridForm.submit({
waitMsg: 'Exporting ...',
url:'server.php',
params:{
'action':'export',
'format':'excel',
'id_project':Project.id_project,
'tab':currentTab.id
},
success:function(form, action) {
},
failure:function(form, action) {
}
});
}

What I want is just a simple link saying server.php?args. Nothing with AJAX etc. because I send back an Excel Export of the data stored in the database. So there will be a excel header sent.

Or is there any possibility with ajax that the user will be prompted to open the excel.

Thanks
Luc

luc98
5 Jun 2007, 1:32 AM
text: 'Export to Excel',
handler : function(){
top.location.href = 'server.php?action=export&format=excel&id_project='+Project.id_project+'id_tab='+currentTab.id;
}

Well finally I found the solution by myself ...