Best control to display a list of records
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Best control to display a list of records
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
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
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
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
Last edited by dunbarx on Mon Nov 25, 2019 9:12 pm, edited 2 times in total.
Re: Best control to display a list of records
You could also use an actual list field (or 2, or even 20) 


-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: Best control to display a list of records
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
Thanks.
Mike
Re: Best control to display a list of records
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
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
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. 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.karmacomposer wrote: ↑Tue Nov 26, 2019 1:13 amSo, list fields can have columns and rows? I need to populate both.

-
- Livecode Opensource Backer
- Posts: 10097
- Joined: Fri Feb 19, 2010 10:17 am
Re: Best control to display a list of records
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.
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.
-
- Posts: 361
- Joined: Wed Apr 27, 2011 2:12 pm
Re: Best control to display a list of records
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
Mike
Re: Best control to display a list of records
Bogs' point is worth elaborating.
Craig
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.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.
Craig
Re: Best control to display a list of records
400,- (FOUR HUNDRED) US dollars, Mike!