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.


    Hightlight a row from table view.

    Pythonista
    3
    3
    1750
    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.
    • ryanvolap
      ryanvolap last edited by

      Hi all.
      I'm new in pythonista.
      I have a question: Is it possible to highlight specific row of a tableview from user input. For instance, I get a tuple (0,2) from a user (section 0, row 2) and it will highlight row 2 of the table automatically (like changing a cell background color).
      Thanks.

      Phuket2 1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 @ryanvolap last edited by

        @ryanvolap , are you talking about TableView.selected_row method? This can select the row programmatically

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

          The other approach would be to have your datasource provide a tableviewcell with a highlight applied based on the list of cells to highlight -- you would have to reload to update.

          Another option is to create your tableviewcell's once, and store these in your datasource. tableview_cell_for_row would need to return the stored cell. But then you have access to the cell, so can change its contents in realtime. This is not recommended if you have a very large table, since you are wasting memory on cells that are off screen.

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