This is how I did it with Jquery - not sure if there is a better way.

 $( document ).ready(function() {

$('#worksheetsgen > tbody  > tr').each(function() {

var filename = $(this).find('td.column_worksheetattachment').text();
var foldername = $(this).find('td.column_id').text();

$(this).find('td.column_worksheetattachment').replaceWith ('<img style="width:100px;" src="/idtapps/web/client/app/assessments/1/form/download/worksheet/' +foldername + '/' + filename + '.">');

//end worksheetsgenlist loop
});



//end doc ready
});
WHERE THE FOLLOWING:


- #worksheetsgen is the id of my datalist
- td.column_worksheetattachment holds the image upload filename
- td.column_id has the row id column
  • No labels

2 Comments

  1. Sorry - wrote to soon.  It only works when there is one row in the table.  Any ideas?

  2. Fixed it!  Now working for all rows.