show picture from jTable in jsp

hibernate jsp servlets jquery-jtable

33 观看

1回复

3 作者的声誉

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

作者: aaaaaa 的来源 发布者: 2017 年 9 月 15 日

回应 1


0

121 作者的声誉

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)
作者: misterP 发布者: 2018 年 3 月 28 日
32x32