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.


    Access to the TableViewCell of a ListDataSource

    Pythonista
    2
    3
    2510
    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.
    • Gcarver166
      Gcarver166 last edited by

      I Have TableView using a ListDataSource with an array of dict items containing the title, and accessory_type of detail_button.
      I am attempting to get the info button in my TableView to show some detail text. I need to set the text on the TableViewCell.detail_text_label.
      ListDataSource.accesssory_action is triggerred correctly but I can't find any way of getting the TableViewCell associated with the activated item. I've looked for them on the root view, the TableView, the ListDataSource and even on my array of ListDataSource items. I was sure the ListDataSource internally creates one of these cells for each of my items but I can't find them.

      Is there no way to get access the cells? Do I have to implement my own ListDataSource so I can call tableview_cell_for_row() to create and maintain my own list of TableViewCells?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        You can use the tapped_accessory_row attribute of the ListDataSource.

        1 Reply Last reply Reply Quote 0
        • Gcarver166
          Gcarver166 last edited by

          tapped_accessory_row is just an index. I need the actual TableViewCell.
          I'm getting closer. It turns out the cell_for_row() method returns the TableViewCell I need. I was assuming it only created new ones because that is what the example in the docs is doing.

          However the detail_text_label is None.
          I guess I have to create my own tooltip label.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors