List vs Table Field

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

List vs Table Field

Post by phaworth » Sat Jul 11, 2009 1:49 am

What are the differences between a list field and a table field? I see from the very brief description in the user guide that users can't edit data in a list field but can in a table field. Anything else? The properties look the same.

Pete

edljr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 56
Joined: Sun Oct 26, 2008 6:47 am
Contact:

List vs Table Field

Post by edljr » Sun Jul 19, 2009 8:03 am

Hi Pete,

Great question. The two differences I have noticed are:
1) They have different default property settings (i.e. grid lines).
2) List fields are easier to deal with than table fields.

An honorable mention in this discussion should be Data Grids that was released as a major feature of 3.5.

Ed

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Sun Jul 19, 2009 5:59 pm

Thanks Ed. I've been looking at Data Grids as well but at first glance, they seem extremely complicated to implement.
Pete

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Post by trevordevore » Mon Jul 20, 2009 1:42 pm

Creating a data grid table that mimics a Revolution field with tabstops set is pretty straightforward and doesn't require any additional work. Take a look at this lesson.

How Do I Create My First Data Grid Table?

When it comes to customizing data grid tables and forms it is more complicated than basic manipulation of the htmlText of a table field. The added benefit is that you can do so much more than you can with the htmlText of a table field.

You need to be familiar with groups, behaviors and (sometimes) arrays. Knowledge of all 3 will help you in all aspects of your Revolution development however and the manual covers a lot of common questions and shows how to implement a number of things. If you have been shying away because it looks too complicated but have yet to give it a try I would recommend jumping in and trying to create a simple little data grid. If there is a question you have that you don't find in the manual then just ask and someone can point you in the right direction.

Revolution Data Grid

Data Grid Tips & Tricks

Data Grid Tutorials
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Mon Jul 20, 2009 4:24 pm

Thanks Trevor. I looked at the whole data grid thing again yesterday and realised that, as you say, creating one to mimic a simple table but with more flexibility) is not very difficult, it's only when you get to more complicated structures that it seems confusing so I'm already trying out the data grid idea.

I'm already using groups and arrays although haven't got into behaviours yet.

Pete

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Tue Jul 21, 2009 12:02 am

Doing nicely with my Data Grid, populating it just fine form my SQLite db. BUT I cannot for the life of me get information out of the grid.

There are three columns in the grid and I'm trying to get at the value of the currently selected line with the following code:

Code: Select all

put the dgHilitedLines of group "ProductList" into tlineNum
put word 1 of the dgDataOfLine[tlineNum] of group "ProductList" into pkeyvalue
The usual answer statements show that tlinenum has the correct line number in it but that dgDataOfLine9tlinenum] is empty.

Any ideas?

Pete

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Tue Jul 21, 2009 2:37 pm

That's because the dgDataOfLine[lineNumber] returns an array, with an entry for each column for that row. Just put it into a variable and take a look at it with the variable watcher.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Post by phaworth » Tue Jul 21, 2009 5:47 pm

Thanks Jan, got it. This code was quickly converted from the code I used when I was using a list field before trying a data grid - didn't look at the lesson hard enough!
Pete

Post Reply