Page 1 of 1
Best control to display a list of records
Posted: Mon Nov 25, 2019 8:57 pm
by karmacomposer
I am rebuilding my application from Python to Livecode and in wxPython, we use a list control to list records from a file.
Which control in Livecode will allow me to read a file, list items in a data-grid like fashion and allow me to single click or double click on lines to pick them and do something?
Thanks.
Mike
Re: Best control to display a list of records
Posted: Mon Nov 25, 2019 9:06 pm
by dunbarx
Hi.
Reading from a file is done with the "read from file" command. See the dictionary.
Storing the (now loaded) data is done in either a dataGrid or a list field. I prefer the list field, generally, unless you want the functionality of a DG form. This is a matter of style, though. The list field contains tabStops and other basic features that serve all my needs, because I never need a DG form, and managing a DG table requires more effort than a list field. I do notice, however, that new users are attracted to the sexiness of a DG when in fact they rarely need one. That said, DG's are powerful and can be beautiful. They just take more work.
Craig
Re: Best control to display a list of records
Posted: Mon Nov 25, 2019 9:10 pm
by bogs
You could also use an actual list field (or 2, or even 20)

Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 1:13 am
by karmacomposer
So, list fields can have columns and rows? I need to populate both. Then I need to be able to send data to another card when a row is double clicked.
Thanks.
Mike
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 3:22 am
by dunbarx
hi.
It is actually table fields that have all that. I misSpoke earlier. Anyway, they are essentially tab and return delimited gadgets, sort of like a spreadsheet, at least in terms of structure.
Try it. Put a few lines of tab dellimited strings into a list field. Now go into the inspector and set some tab stops.
But know that there is a small issue with table fields. See this:
viewtopic.php?f=7&t=31452&p=170731&hili ... ly#p170731
This is not too onerous, and not a reason, in my opinion, to eschew table fields.
Craig
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 11:22 am
by bogs
karmacomposer wrote: ↑Tue Nov 26, 2019 1:13 am
So, list fields can have columns and rows? I need to populate both.
All field objects have that ability, far as I understand them, even the plain Jane fields. You can create tables from
code or property settings.

- Lemme check to see if your on the list....
Alternately, you can 'tie' 2 (or more) fields together, depending on the structure of the data you are using
or the properties set for a field, just by splitting items. It all depends on how much work you want to put into something.

- Tie a yellow list field 'round that old oak treeee.....
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 1:09 pm
by richmond62
There is a school of thought that "somewhere up there" the
Table Field has been overlooked because it was felt that all
the end-users would be so impressed by the dataGrid that
they would not bother with the Table Field.
If this is true that is a great pity as the Table Field has
a lot going for it.
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 2:43 pm
by karmacomposer
Thank you. The table field may be perfect. I do not need total spreadsheet functionality. I just need rows and columns and populate each row with data and allowing the user to double click on a row to select it and do something.
Mike
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 3:26 pm
by dunbarx
Bogs' point is worth elaborating.
All field objects have that ability, far as I understand them, even the plain Jane fields. You can create tables from code or property settings.
There is only one basic field object in LC. So it is possible for example, to transform one style into another by setting the appropriate properties. You can watch a plain Jane field morph into a table field step by step as you set each property correctly in turn. You can do the same with a plain Jane button, changing it into, say, a popUp.
Craig
Re: Best control to display a list of records
Posted: Tue Nov 26, 2019 3:59 pm
by Klaus
400,- (FOUR HUNDRED) US dollars, Mike!