Forum Archive

Sheet View

mikael

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

@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 🤔