taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Carousel Array Mapping with JS

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,

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Carousel Array Mapping with JS

Hello,

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

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

taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Carousel Array Mapping with JS

:) 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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Carousel Array Mapping with JS

Could you clarify what exactly doesn't work?

taucher
Posts: 0
Joined: Fri Apr 17, 2015 6:06 am

Carousel Array Mapping with JS

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Carousel Array Mapping with JS

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

Return to “Issues”