This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Tarun Chakravorty
Posted Aug 14 - Read on Facebook

Hey framer friends,

I have a basic question on arrays. I have a simple list view that I'd like to add interactivity to. When I import this sketch file in the screenshot, I have an array called listView and I can type something like *print listView.children* to see all the items in it.

My question is - how do I attach an *onTap* to each of the rows in this listView? My n00b attempt of *listView.children.onTap* throws an error.

2 Comments

Rafael Marin

You can use a loop for that:

for item in listView.children
item.onTap ->
print @

JinJu Jang

Consider make a function, I made a simple demo for you. Let me know if you have any more questions! http://share.framerjs.com/5ey76x4pa14d/

Read the entire post on Facebook