Page 1 of 1

setting image in list during rest call

Posted: Mon Dec 02, 2013 11:42 am
by Ram

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.


setting image in list during rest call

Posted: Mon Dec 02, 2013 12:54 pm
by Maryna Brodina

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


setting image in list during rest call

Posted: Mon Dec 02, 2013 1:07 pm
by Ram

Youre the BEST!!!
thx much!