The Accidental Rubyist

invalid byte sequence in UTF-8

Editable Multi-column tables

leave a comment »

Quite excited to share that I’ve just got editable tables coded and running. String, numeric, checkboxes (for boolean) and combolists. That sort of covers the minimum requirements of an editable table. Also see earlier post with a non-edit table that allowed column moving, resizing etc.

Editable table

Editable table

A quicktime file demos this 2.6 MB).  Updated on Jan 16th.

1. Keys! One needs to decide whether editing should automatically happen when you enter a field (I have used that approach in the editable lists) or upon a key.
In tables, I’ve starting editing on hitting ENTER. Save also on hitting ENTER. Esc or C-c cancels edit.

The demos shows me editing a couple of string fields, cancelling an edit, toggling a checkbox and then changing values in a combo list on 2 rows. All this is easily possible due to CellRenderers and CellEditors. Thus, one can easily add another widget onto a table, and just run some tests to ensure it’s working and displaying fine.

I guess now for some time, I will tweak and clean up – nothing new. I shall try writing some sample apps, to figure out anything missing, integrating this with some yaml files and a database. Perhaps a table row sorter could happen (I love writing new stuff!)

Edit: Updated demo. You can also see events being fired in the Events field below.



Written by totalrecall

January 13, 2009 at 1:58 am

Posted in ncurses, rbcurse, ruby

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: