I have a feature request that I feel is useful in numerous cases.
Namely: the ability to register events handlers on individual items of a ListView.
Imagine a basic email interface:
On the left panel, I have a listview with a list of emails subjects for example, and on the right is a panel that loads the content of the selected email.
I want to be able to click on the entire list item which contains (the email subject, email address, and various other data) in order to trigger the query that will load the email content on the right.
Right now I'm forced to put a button inside the list item to solve it. Which is not ideal UI-wise.
Is there such a thing in the work? Or any other workaround ?
Thanks
Hey louislafont, This should be possible currently. You can set an 'On click' event handler on the Container (assuming your entire list item is in a container) in your Listview. This event handler can trigger a query in which you can reference {{ i }}
to refer to the index of the list item that was clicked. Using this index you should be able to pass the specific information from the list item to your query.
Here's a simple example where I have Text Components in Containers as my list items. I set an 'On click' event handler on the Container Component. In the query that I trigger, I key into the Text Component using i
in order to reference the specific value (in this case a name) from the Text Component at the index of the clicked container. I limit my query to names that match the name at that index.
Following this pattern, you should be able to build out your use case. I hope this helps 