Page 1 of 1

Carousel Array Mapping with JS

Posted: Tue Oct 06, 2015 10:16 am
by taucher

Hello, i am trying to map a json array(image URL) response to the carousel component with custom js. In mapping, i bind the array to the mobilecarouse# but i need to check if the response is not empty, then map them to the image url. I check with if statement in custom js, then how can i bind the values to the carouse.

I tried: code$(element).find("[name=mobilecarousel#]").attr("data-image-url"), myvar)/code

Thanks,


Carousel Array Mapping with JS

Posted: Tue Oct 06, 2015 3:47 pm
by Serhii Kulibaba

Hello,

This is incorrect carousel's name:
"mobilecarousel#"

Name have to contain only a-zA-Z symbols, numbers and "_"


Carousel Array Mapping with JS

Posted: Tue Oct 06, 2015 4:30 pm
by taucher

:) I know Sergiy. I just want to sample them. There is the component number at"#". it is "mobilecarousel_172" in real.

Sorry for writing like that.


Carousel Array Mapping with JS

Posted: Tue Oct 06, 2015 7:55 pm
by Serhii Kulibaba

Could you clarify what exactly doesn't work?


Carousel Array Mapping with JS

Posted: Tue Oct 06, 2015 8:11 pm
by taucher

I saw some posts about this. It is said that we can not map to carousel with js. We need to write js code after success response of service. I know it is working with visual mapping(no js). But i have some logical functions when mapping the images to carousel. So i need to use js code. But i tried lots of js. Couldn't achiebe it.


Carousel Array Mapping with JS

Posted: Fri Oct 09, 2015 8:29 pm
by Serhii Kulibaba

You can do all your functionality with JS and save results to the storage variable. After that you can use it in the mapping