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.


    Sheet View

    Pythonista
    2
    2
    858
    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.
    • mikael
      mikael last edited by

      Apple's UITableView seems poorly named, ListView would be more descriptive, and Apple's widgets miss an actual table view.

      Here's a first iteration of what I dubbed a SheetView, with the main feature being the row and column headings that stay visible as the sheet is scrolled.

      Sheet view demo

      API is very simple:

      sheet_view = SheetView(column_headers, rows)
      

      column_headers is a list of strings for the column headers, rows is a list of rows, as lists of items that can be presented as strings.

      There are lots of potential improvements one can think of, at least:

      1. Autosizing columns
      2. Configurable column types
      3. Standard TableView features like delegates, deleting, moving and editing.
      4. SQL table backend

      I also remember that @cvp created something similar a while ago, but I could not find it - wonder of there would be something I could incorporate?

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @mikael last edited by

        @mikael said:

        created something similar

        I often use tableview_cell_for_row to display columns in a TableView but I don't have any generalized code, or I already have forgotten, what is obviously possible 🤔

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