show picture from jTable in jsp

62 Views Asked by At

I use jTable to display information in the database That's the problem How can I display the images in the table I need a sample to implement what I'm thinking of I want to use the jsp page

1

There are 1 best solutions below

0
On

Late to the party, but this question does seem to be of interest. All you need is a display function for your image column. Something like

image: {
    title: 'Image',
    list: true,
    edit: false,
    create: false,
    display: function (data) {
        return $('<img />')
            .attr('src',data.record.image)
            .addClass("my-image-styling-class"); 
    }
},

This assumes the server is sending the full url of the image.

I personally avoiding send the real url of an image file, I'd rather go through an image server app, so I'd have the server send a processed url or replace the src line with something like

.attr('src','myImageServer.php?id='+ data.record.image)