Announcement

Collapse
No announcement yet.

Change image in field of grid based upon field content

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change image in field of grid based upon field content

    Hi - I have a grid with multiple columns and rows. Assuming the one column is called "alert". Alert can either be "0" or "1". I would live the grid to show a different image based upon whether its value is "0" or "1".
    I assume this is done in the onRecord event.

    I just can't seem to make this work. Please can someone advise.

  • #2
    Where do you want to show this image?

    If you want to show this image in your grid you can use next code. First make a next field eg pic (HTML image) and add the code to your onRecord event.

    HTML Code:
    if ({alert}==1){
        {pic}='<img src="https://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com">';
    }else{
        {pic}='<img src="https://www.w3schools.com/images/picture.jpg" alt="Mountain">';
    }

    Comment

    Working...
    X