Author Topic: Image into a cell  (Read 2527 times)

dcalvo

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Image into a cell
« on: September 03, 2015, 06:55:32 pm »
This is my first post and my english is terrible. I´m sorry for that.

I have a grid that shows the user`s list of the system. For security reasons, I need to add a column with the Photo ID of user. There area a way to add an HTML img tag into a cell?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6265
    • View Profile
Re: Image into a cell
« Reply #1 on: September 03, 2015, 07:37:00 pm »
An img HTML tag can be added in column.render callback.

Assuming you have the src attributed saved in data field.

column.render = function( ui ){
  return "<img src = '" + ui.cellData + "' />"
}

Example for usage of img tag in column.render

http://paramquery.com/pro/demos/render_cells
« Last Edit: September 03, 2015, 07:38:36 pm by paramquery »