omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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.


    Tableview row selected... not working?

    Editorial
    bug report tableview rowaction bug
    1
    1
    2263
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jessearwhite
      jessearwhite last edited by jessearwhite

      I've tried both my own custom UI and other workflows and it looks like when you select a row in a table using the basic UI builder nothing happens, dumbed This down to just a simple table that shows an alert...

      Is this already known? If so I couldn't find anything about it... Going to do this in UI/python now but it's overkill for the simplicity I actually need.


      Got this working by adding the following to view appeared on the main view, it just saves the selected row into a variable for later (All I really needed):

      Workaround

      import os
      import editor
      import workflow
      
      class MyTableViewDelegate (object):
          def tableview_did_select(self, tableview, section, row):
              # Called when a row was selected.
              workflow.set_variable('selected', tableview.data_source.tableview_cell_for_row(tableview, section, row).text_label.text)
              pass
      
          def tableview_did_deselect(self, tableview, section, row):
              # Called when a row was de-selected (in multiple selection mode).
              pass
      
          def tableview_title_for_delete_button(self, tableview, section, row):
              # Return the title for the 'swipe-to-***' button.
              return 'Delete'
      
      v = workflow.get_view()
      tableview = v['tableview1']
      tableview.allows_selection = True
      handler = MyTableViewDelegate()
      tableview.delegate = handler
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Powered by NodeBB Forums | Contributors