how to display images in datatables ?

how to display images in datatables ?

ayaradwanayaradwan Posts: 2Questions: 1Answers: 0
edited June 2015 in Free community support

I get an array from database and pass it to datatables and it works good (Y) BUT IF this array contain picture's URL,SO how ca I show it in datatables??

$data_set = "[";
    $count_rows = count($objects);
    $count = 1;
    foreach($objects as $object){
       $data_set .= "['". $object['reportID'] ."', '". $object['email'] ."', '". $object['date'] ."', '". $object['time'] ."', '". $object['BasketID'] ."', '". $object['notifyEmployee'] ."','". $object['replyedPhoto'] ."']";
        if($count != $count_rows){
            $data_set .= ",";
            $count++;
        }
    }
    $data_set .= "]";
    

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin
    Answer ✓

    You just need to modify your data output to include whatever HTML you require in the cells. DataTables will show it as it just writes the value to the innerHTML property of the cell.

    Allan

  • ayaradwanayaradwan Posts: 2Questions: 1Answers: 0

    I solved by writing the <img src > in my function

This discussion has been closed.