Page 1 of 1

Just how basic is the Basic Table Field?

Posted: Fri Aug 05, 2011 6:29 am
by BarrySumpter
Finished researching Arrays and converting them into strings for the Basic Table Field Text.
The strings having tabs to seperate into table columns.
And the strings having returns to seperate into table rows.
Then assigning the string to the Basic Table Field.

Now I'd like to add column and row headers.
Adjust the width of each column.
Adjust the height of all the rows.
Perhaps even color a row, a column, a cell background, or the text of a cell, row, or colum, etc.

Can't seem to find any other info on the Basic Table Field.

I'd like to find out the limits of the Basic Table Field before moving to the data grid.
So I'm just looking for info pertaining to the Basic Table Field.

Any positive constructive assistance, regarding the Basic Table Field and any more of its functionality, would be greatly appreciated.

Re: Just how basic is the Basic Table Field?

Posted: Fri Aug 05, 2011 8:00 am
by SparkOut
It is very very basic indeed. It is possible to do advanced things with it, but those things involve a lot of "roll your own" scripting.
Column widths : see the tabStops property
Row height : see the lineHeight property
For the rest, column headers would be best done as a separate field or even buttons, styled and sized and grouped, and set to match any scrolling or resizing of the table field. Row captions probably in a similar way. Colouring parts of the table field would be possible in exactly the same way as with any other field - so setting the backcolour of some text would be perfectly reasonable, but for a table field you can pretty much forget any concept of "cells" (unless you roll your own) so it actively highlighting the whole "cell area" with a backcolour would not work (the cell area itself is not a chunk).
You cannot set different column alignments within the table field. It is a basic table field, and can only do (very) basic things unless the developer is prepared to add the more advanced things him/herself.
For an alternative "somewhere in between the table field and the datagrid" have a look at "List Magic" as well as your other mentioned research.

Re: Just how basic is the Basic Table Field?

Posted: Fri Aug 05, 2011 8:42 am
by BarrySumpter
Thanks for that reply.

Yes, I came from a VB and RB background.

It did take some time and concentration
to see the Basic Table Field as a slighly advanced Text Field.
And NOT as a light version of a (rich) datagrid.

I'll have a good look at the datagrid before considering rolling my own.
I'd prefer not to use a 3rd party control as my experince is
the 3rd party controls I just happen to pick turn into vaporware.
Unless I get the code as well.

So me trying to stay focused on what the Basic Table Field can and can't do...

So we're writing that somehow I CAN color the background? And/or/only the foreground(text).
I acknowledge the concept is coloring the line of text in a list instead of a row in a grid.
I'm sure I've seen a 'how to color' a line in a list field.
May have been just the text and not the background.
I'll chase that down.

tabStop for Column widths and lineHeight for Row height - would never have picked either of those.
But not surprised since it IS LiveCode. LOL
Will have a go.

No column headers in the Basic Table Field.
No row headers in the Basic Table Field.
No column alignment in the Basic Table Field.

Thanks super heaps for saving me hours of wondering about blindly.

OK, now that we've quantified the Basic Table Field a bit more,
concluding thru this research the Basic Table Field is 'VERY basic',
other than a quick way to view a list of data, why would I use the Basic Table Field over a DataGrid?

Re: Just how basic is the Basic Table Field?

Posted: Fri Aug 05, 2011 8:56 am
by bn
Hi Barry,

As Sparkout pointed out: the basic table field is very basic. One can tweak it but after a lot of scripting it still is basic.

Once there was a discussion here about it and as a result I tried to modify the table field so that one can drag the vertical dividers to fit the content and a autoFit function to do that for all columns. You can find it here:
http://revonline2.runrev.com/stack/428/ ... agDividers

Best is to forget about the table field for presenting and working with structured data.

Kind regards

Bernd

Re: Just how basic is the Basic Table Field?

Posted: Fri Aug 05, 2011 9:32 am
by BarrySumpter
bn wrote:...
Best is to forget about the (basic) table field for presenting and working with structured data.
...
Yes, acknowledged and would have to agree based upon my research so far.

But had to be researched enough to where I am confident when to use it and when not to.
(Was thinking someone would mention the memory size needed would be considerably smaller.
But the difference isn't enough to be concerned with.)

Would be happy to read more about when and where to use the Basic Table Field if anyone would like to add anything.

Otherwise, I'm off to see the dataGrid.

Thanks each and everyone who contributed to this reseach either here in the forums or elsewhere.

You've made this a very productive two days and I've learned alot more about LiveCode.

You guys rock!

Re: Just how basic is the Basic Table Field?

Posted: Sun Aug 07, 2011 1:46 am
by Mark
Hi,

Both Windows and Mac have a native table object. I have never understood why LiveCode doesn't use these objects instead of the old table field and the newer datagrid.

(2ยข)

Mark

Re: Just how basic is the Basic Table Field?

Posted: Sun Aug 07, 2011 1:51 am
by BvG
I never use the basic table field. Mainly because it used to have weird problems and bugs. instead I use the normal list field, with tabstops and vGrid (vertical grid on the table pane of the inspector). But only to show raw data. for a slightly better tabular representation I have made my own table group, but only adding resizing, named buttons on top and ordering. This is only for internal (read: my own) usage. for User interactive tabular data, it's the datagrid.