Skip to Content
avatar image
Former Member

sap.m.table - change image in row dynamically

hi,

i've a table implemented with images (small image icons) as one of the columns. that images column has a formatter which displays different images depending on the value that comes from oData service.

now the requirement is at reach row level: table has a action (link or buttom) which does some processing and comes back with the update row. and here the value of the image change is changed, i'm unable to figure it out on how to change the image when its values is change?

for ex:

for val=1 show image=Male Icon

for val=2 show image=Female Icon

for val=3 show image=Group Icon etc...

for val=0 show image=None

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 06, 2015 at 04:29 AM

    HI Box

    Would this help?

    Example

    -D

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 08:25 AM

    Hello Box,

    I have modified your example a bit and now when you change the value in the input the icon changes. The problem was that you are checking for a strict number (with ===) but what comes from the input is a string. It should be no different if you have a button which when clicked performs some logic and updates the values in the model.

    Here is the modified example - JS Bin - Collaborative JavaScript Debugging

    Best,

    Deyan

    Add comment
    10|10000 characters needed characters exceeded