Kevin Dangoor <[EMAIL PROTECTED]> writes:
> What do you think of the "add row/remove row" model?
I thought about it as well, but then it just "breaks" the flow of data typing
(well, not so much since there will be 2 TABs and 1 space more for each
line...).
I've come up with a solution -- and posted the code to the list, by now you
probably saw that -- that makes it more fast to enter series of data.
The "add/remove row" would be a solution that could be as good as this one if
it was easier. But since it would just save me from the loop (and reading the
amount of rows before generating the table), I don't see much gain.
> It should be possible, to make a container widget that knows what
> kind of entry widgets to use for each row, use JavaScript to
> add/remove those as needed, and to use FormEncode's variabledecode
> capability to automatically get a nice set of data back. The one thing
Using FormEncode here would be really a plus! I'll have to loop on the Python
side and call FormEncode manually to do that. Having it automatically done
would be very very nice and I wouldn't even bother to change to the add/remove
row model if it was required.
> that's missing is ability to change the widget's name for each
> rendering (but we can come up with an API to do that).
I believe it is worth. How can I help? ;-)
Another idea that is common in GUIs is inserting every row when you create the
next one. Or when you press "ENTER". (Pressing ENTER to create a new row
when in the last 'cell' is also interesting.) This would save from having to
generate an individual id for each input.
Then, after insertion, one could create some way to enable data editing or
just make it a normal string, and providing another form to edit each line
individually... (Today, I'm not allowing editing of series of samples, just
individual samples.)
What I'd like to have:
- specify how many lines / columns (lines is optional, if using
add/remove model)
- specify header names (being able to specify no
header name as well)
- specify what should go on every column (either data or form
components)
- specify footer names (same constraints /
requisites as for headers)
I can achieve that easily enough with the JavaScript I posted here.
Some way to encapsulate it and apply formencode validators would be really
great. Also, an automatic loop providing a dictionary without the "line
number" (mine has "1:colname", "1:anothercol", "2:colname", "2:anothercol",
etc. to mark every row) for each line -- an array of dicts come to my mind, or
even a dict of dicts, where the first key is the line number... -- would also
make it easier to work with. These are deficiencies I don't know -- yet --
how to address.
I'd name a component like this "datatable". One just for results I'd call
"dataview".
Another interesting component would be the one similar to a databrowser, where
you can paginate trhough records, showing one at a time and with buttons for:
- next/previous record
- next/previous "n" records (n > 1 and n < count(records), or even
better, allowing an arbitrary filter
to return the next / previous record)
- last/first record
These are the components that I miss the most from GUIs. It is not hard to
implement using JavaScript + JSON, but having them on "TG Standard Library"
would be a huge plus. :-) Integration with FormEncode is an invaluable
addition.
Be seeing you,
--
Jorge Godoy <[EMAIL PROTECTED]>