Ram
Posts: 0
Joined: Fri Aug 02, 2013 12:15 pm

setting image in list during rest call

Dear Appery,

i have a list and within the list there is an image, the list is population via REST call, my goal is to set the image according to one of two possible values, i mapped the setting value to the asset filed:

Image

and in the asset JS i added this code:
precode
if (value == 'Incoming') {
Appery('imgDirection').attr('src', 'files/views/assets/image/incoming-callcolour21.png');
}
else
{
Appery('imgDirection').attr('src', 'files/views/assets/image/outgoing-callcolour2.png');
}
/code/pre

when running the app i dont get any error but i dont get to see any image also, i checked the image path and its okay...

any thoughts what is it i'm doing wrong here?
Many thanks in advance!!
Best,
R.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

setting image in list during rest call

Hello! Try this way preif (value == 'Incoming') {
return Appery.getImagePath('incoming-callcolour21.png');
} else {
return Appery.getImagePath('outgoing-callcolour2.png');
}/pre

Ram
Posts: 0
Joined: Fri Aug 02, 2013 12:15 pm

setting image in list during rest call

Youre the BEST!!!
thx much!

Return to “Issues”