Ajax DataGrid Support Product Page

This topic is locked

How to download file on click? - resolved

Asked 12 Jan 2011 21:37:19
has this question
12 Jan 2011 21:37:19 Sally Carr posted:
I have a grid that has a field with the file name on the server. I want to have a onrowclick that downloads the file. For example, the file (docFile) is in the uploads directory and onrowclick that file (based on the docID) is opened in the window. I am trying to do this using the following code but it doesn't work.

onrowclick: "MM_goToURL('parent','/uploads/<?php echo $row_rs_documents['docFile']; ?>?<?php echo $row_rs_documents['docID']; ?>=');",

Can you tell me where I'm going wrong? Thanks.


Replied 13 Jan 2011 14:28:08
13 Jan 2011 14:28:08 Sally Carr replied:
Thanks for the great Live Support!

Just in case someone else is wondering, what I needed to do was use the column numbers (starting with number 0) in the datagrid instead of the column names. Column #5 was the name of the file and column 0 was the ID for the row. So the code that worked looked like this:

onrowclick: "MM_goToURL('parent','your_path/{5}?id={0}');",

Thanks again for your help!

Reply to this topic