cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.table - change image in row dynamically

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

former_member182862
Active Contributor
0 Kudos

HI Box

Would this help?

Example

-D

Former Member
0 Kudos

hi Dennis,

that part is already completed, what i'm looking for is this. where if i change the value from 1 to 2 in last column, it has to show 2's image.

Former Member
0 Kudos

i think this way its possible! will have to put it in actual code and check. plz validate if any otherway to handle this.

former_member182862
Active Contributor
0 Kudos

Hi Box

I have simplified your JSBin.

Example

-D

former_member182862
Active Contributor
0 Kudos

Hi Box

Do you need more support?

-D