tonycpsu / panwid

A collection of widgets for urwid.
GNU Lesser General Public License v2.1
112 stars 8 forks source link

architecture overview of datatable #6

Open dotnwat opened 6 years ago

dotnwat commented 6 years ago

Hi, this project is awesome. I was looking for a table for urwid and stumbled across this. I've been looking through the code for a little bit, but was still a little uncertain about the basic architecture of the datatable.

That is, what is hierarchy and composition of the urwid components (e.g. list of columns, etc...). Would you mind describing this a little bit? Thanks.

laixintao commented 6 years ago

I have used this lib, from my view you need:

  1. Define your Columns as list, eg: name, label, how to sort, etc https://github.com/tonycpsu/panwid/blob/master/examples/datatable.py#L62
  2. Implement query(), this defines how do you get your rows: https://github.com/tonycpsu/panwid/blob/master/examples/datatable.py#L126