Skip to content

How to get a specific item from the collection #37

@Whip

Description

@Whip

I want to know how I can get a specific item's view from the collection using index or some other way. @farfromrefug told me about getViewForItemAtIndex in #17 but haven't been able to make it work. I need to do some work on each item of the list when the user presses a button (not part of collection). Here's my code:

const collection = page.getViewById('collection');

for (var i = 0; i < listItems.length; i++) {
  const listItem = collection.getViewForItemAtIndex(i);
  console.log(listItem); // undefined
}

Since there's no documentation on it, I'm just shooting in the dark here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions