Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82038

Changing display type based on file type.

$
0
0

Hy guys,

I am using the editor successfully ( amazed at how much you can do with it).

I am upload image / pdf / txt and xls files to my server.

I now need to show these in a datatable.

I use

"data": "web_path",
                        "render": function ( data)
                        {

              return '<img src="'+'http://toolfolks.com'+data+'" style="height:50px;width:50px;"/>'
                        }

which is fine for images & pdf.

If the file is not image type how do I set the cell to show the filename and be downloadable. IE they click on it and it down loads.

Cheers

Steve Warby


Viewing all articles
Browse latest Browse all 82038

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>