I have added a button to each row of a listView in the onRowRender:
local delButton = widget.newButton{
id = row.index,
top = row.contentHeight * .075,
left = row.contentWidth - 80,
defaultFile = “assets/deletebtn.png”,
width = 64, height = 33,
onRelease = delRow,
}
row:insert(delButton)
delButton.isVisible = false
I want to show/hide the “Delete” button on left/right row swipe. I also want to shift the row text to the right and display a “linkage” button under other circumstances. I used to be able to access the row text and row buttons as objects from the event handlers, now Im sure you can do it but I cant figure our how. Im looking in the row table and the target tables but not finding any way to access these. Anyone know?
Not sure how I close this but I got it - you just add whatever to object to the row contents and then access them directly:
row.delButton = delButton
OK, it gets a little messy until they add .parent.rows back into the row object, but for now you can add a reference to the parent listView table directly to the row in RowRender:
row.parentList = list – (assuming the “list” assigned is a listView defined elsewhere)
and then access it thus:
row.parentList._view._rows[rowindex]._view.linkButton.isVisible = true
So you can access other rows’ table contents from within the event handler for another row
Not sure how I close this but I got it - you just add whatever to object to the row contents and then access them directly:
row.delButton = delButton
OK, it gets a little messy until they add .parent.rows back into the row object, but for now you can add a reference to the parent listView table directly to the row in RowRender:
row.parentList = list – (assuming the “list” assigned is a listView defined elsewhere)
and then access it thus:
row.parentList._view._rows[rowindex]._view.linkButton.isVisible = true
So you can access other rows’ table contents from within the event handler for another row