In the example below I have a button on each listview item which when clicked I'd like it to update the model binded to that item. I can get the onClick event to work but can't work out how to get item data to then update the model. Is this even possible?
index.xml
<Alloy> <Window> <ListView id="list"> <Templates> <Require src="itemTemplate"/> </Templates> <ListSection dataCollection="collection"> <Require src="listItem"/> </ListSection> </ListView> </Window> </Alloy>itemTemplate.xml
<Alloy> <ItemTemplate name="user" height="70"> <Button id="update" onClick="updatedUser" /> <Label id="name" bindId="name"/> </ItemTemplate> </Alloy>listItem.xml
<Alloy> <ListItem template="user" name:text="{{name}}"/> </Alloy>itemTemplate.js
function updatedUser() { //change an attribute on the model and save }