I'm just wondering if there's something really obvious that I'm missing.
I have a custom view class with a tableview and the tableview.data_source is a ui.ListDataSource.
What I would like to do is handle deletion of items from the list. I know that we have this edit_action but I think the issue I'm having is, how can I pass on or get the deleted row index? I can get this information for selected_row but I can't get it for deleted_row.
(And no, selected_row doesn't work because you can delete something other than the selected row...!)
Example:
def selected(sender):
selected_row = sender.selected_row
def delete_row(sender):
deleted_row = sender.deleted_row #something like this doesn't exist
I have tried variations of setting the delegate etc. Maybe there's something I could do there...not sure. But so far, hasn't worked.
At the moment I have settled for using edit_action, getting the difference between a before and after list to determine the row, and then going from there.
Anyway... I'm doing a bit of gymnastics with this code now and it's possible I just need to do something like sitting down.
Always always....thanks for your help!