Emitting the current index from a custom component inside a listview

I have a listview that has a custom component in it. When something happens inside the custom component (like pressing a button to remove), I want to trigger a JS query that will send the "i" of the component, so I can remove that particular element from the listview. How can I achieve this? I am not able to pass additionalscope when triggering a query from inside the custom component and I wouldn't know the index of the element triggered that query.

I was able to solve this by using a model property "deleteMarker" and in the query that triggered, I am looking through all the components in the listview for model.deleteMarker=true and finding the index that way... This may not be ideal if we have a large number of components in the list, but for my usecase, this is good.

1 Like