Best control to display a list of records

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Best control to display a list of records

Post by karmacomposer » Mon Nov 25, 2019 8:57 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Best control to display a list of records

Post by dunbarx » Mon Nov 25, 2019 9:06 pm

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
Last edited by dunbarx on Mon Nov 25, 2019 9:12 pm, edited 2 times in total.

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Best control to display a list of records

Post by bogs » Mon Nov 25, 2019 9:10 pm

You could also use an actual list field (or 2, or even 20) :D
Image

karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: Best control to display a list of records

Post by karmacomposer » Tue Nov 26, 2019 1:13 am

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Best control to display a list of records

Post by dunbarx » Tue Nov 26, 2019 3:22 am

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

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Best control to display a list of records

Post by bogs » Tue Nov 26, 2019 11:22 am

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.
ksnip_listFieldTable.png
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.
ksnip_listFieldTable2.png
Tie a yellow list field 'round that old oak treeee.....
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Best control to display a list of records

Post by richmond62 » Tue Nov 26, 2019 1:09 pm

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.

karmacomposer
Posts: 361
Joined: Wed Apr 27, 2011 2:12 pm

Re: Best control to display a list of records

Post by karmacomposer » Tue Nov 26, 2019 2:43 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Best control to display a list of records

Post by dunbarx » Tue Nov 26, 2019 3:26 pm

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

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Best control to display a list of records

Post by Klaus » Tue Nov 26, 2019 3:59 pm

400,- (FOUR HUNDRED) US dollars, Mike!

Post Reply