Using mRender to display image not working

Using mRender to display image not working

dtjimdtjim Posts: 1Questions: 1Answers: 0

Referring to this page: http://legacy.datatables.net/ref#mRender

I'm attempting to display an image from a database reference.

I need to display images on the very first column.

Here's what I got so far:

$(document).ready(function () {
    var _dataTable = $('.datatable').dataTable({
        "aoColumns": [
          {
              "mData": "logo",
              "mRender": "[, ].name"
                }

        ]
    });
});


$(document).ready(function () {
    var _dataTable = $('.datatable').dataTable({
        "aoColumnDefs": [{
            "aTargets": [0],
            "mData": "logo",
            "aoColumns": [{
                "mRender": function (data, type, full) {
                    return '<img src="' + data + '"></>'
                }
            }]
        }]
    });
});

This is a bit over my head at this time, any help is appreciated, thank you!

This discussion has been closed.