Is there a .selectedItem for Listviews?

I'm trying to open a modal with dependent information from a selected item in a listview but I can't seem to find any properties that return which item is selected within the listview. I understand that the .data contains the objects but it's the click event that I'm trying to suss out.

1 Like

@Bill_Waring - is the click event in the list view or somewhere else? for example, are you adding a modal for each item in the list view to then open for that item? Or is the modal somewhere else outside of the listView component?

@ScottR I think I figured it out. I used a click event to set a temporary state variable to {{i}} and then used that to identify the object that I referenced the data from.

1 Like

can post a screenshot and any js code related to performing this operation, please?

@doghousedev sure! Create a temporary state variable. Then in the click event for the container, have it set the state value to the index value of the listview. Then you can call the index value in a query to find the document.

1 Like

Thanks! This looks closer to what I was thinking. The previous solution works too, but this might be easier extend with the database method I was using to load the tabs.