How to display image in a cell

How to display image in a cell

AdamPetre73AdamPetre73 Posts: 2Questions: 1Answers: 0

Hello. I want to display an image in one of the cells, and I got stuck here...
Here's how my field looks:

{
                label: "Flag:",
                name: "msg_flag",
                type: "select",
                options: [
                    { label: "None", value: "" },
                    { label: "Green", value: "../images/green_flag_16.png" },
                    { label: "Blue", value: "../images/blue_flag_16.png" },
                    { label: "Red", value: "../images/flag_red.png" }
                ]
            }

Can anyone help me with displaying the image in the cell?

Answers

  • mrd05dmrd05d Posts: 45Questions: 6Answers: 3

    You are trying to display an image in a table cell? Passing the html doesn't work? <img src="../images/green_flag_16.png">

  • AdamPetre73AdamPetre73 Posts: 2Questions: 1Answers: 0
    edited July 2015

    Thank you for your reply, but I've solved it already.
    I've used mData to display the data wrapped in a <img...> tag.
    aoColumns: [ { "mData": "msg_flag","mRender": function ( data, type, full ) { return '<img src="'+data+'"></>'; } }, .... ]

This discussion has been closed.