Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Using delete in ui.Tableview
-
I have done a few searches on this site, and others and have been unsuccessful at finding the right way to approach this. At the very least I was unable to extract how to make this specific task work.
In the ui module when you have an object in the Tableview you can swipe left and it gives you the Delete option. When you click on it, it removes the row. How do I modify that action to take additional actions? I.e. I want to add a confirm dialog, probably with console.alert() and then not only remove the item but send pcommands to delete the file associated with it?
I currently don't have code that represents this task well, but if any of my other code in generating the Tableview data would be helpful please let me know and I will be happy to post. I am not using any delegates at the moment, since I am having trouble getting them to work, which might be part of my problem. I should also note that I am using the GUI creation tool for building the interface.
And suggestions would be appreciated. Thanks!
-
if any of my other code in generating the Tableview data would be helpful
Posting your existing code is always helps.
import os import ui ui.TableView(__name__, data_source=ui.ListDataSource(items=os.listdir())).present()
See the
ui- tutorial
https://github.com/Pythonista-Tools/Pythonista-Tools/blob/master/UI.md
andfilenav
https://github.com/Pythonista-Tools/Pythonista-Tools/blob/master/Utilities.md -
I found this example useful. Hope it helps.
https://forum.omz-software.com/topic/1524/simple-demo-of-tableview-logic-for-the-novices