How to create a link in one column data item that leads to dounload link put in other column's data

How to create a link in one column data item that leads to dounload link put in other column's data

RaedShakerRaedShaker Posts: 2Questions: 1Answers: 0
edited May 2014 in DataTables 1.9

Hello;
I'm novice user;
I need to make one column data to hold a a download link stored in another column's data
My table holds list of docs {Title, File path(hidden),Author, Date, File Type}
I need to assign a link to the {file type} data item that points to the {file path} stored in the hidden column; any help please !

Answers

  • RaedShakerRaedShaker Posts: 2Questions: 1Answers: 0
    edited May 2014

    I solved my question, no body cared to answer though !!
    thanks for all who tried to help... I'm using Ver. 1.9.4 and here is my datatable definition for the claimed case:

    $('#example').dataTable( {
                        "aaData": aDataSet,
                        "aoColumnDefs": [{
                                            "bVisible": false, "aTargets": [1] } ],
                        "aoColumns": [
                            { "sTitle": "Title"},
                            { "sTitle": "File","sWidth":"300px",},
                            { "sTitle": "Doc Type","sWidth":"60px","sClass": "center"},
                            { "sTitle": "Publisher" ,"sWidth":"70px","sClass": "center"},
                            { "sTitle": "Year","sWidth":"30px","sClass": "center"},
                            { "sTitle": "Pages","sWidth":"30px","sClass": "center"},
                            { "sTitle": "Format",
                                                     "sClass": "center",
                              "sWidth":"30px",
                              "fnRender": function(obj) {
                            var sReturn = obj.aData[1];
                            return "<a href='files/"+sReturn+"' target='_Blank'>"+ obj.aData[6]+"</a>";
                            }                       
                            }
                                                  ]
                    } );
    

    So that the rendered content in the last column will hold the link to the file name stored in the hidden second column.
    Thanks for all

This discussion has been closed.