Tables - adjustable columns or merging cells

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kellymdeters
Posts: 23
Joined: Wed Oct 31, 2007 9:16 pm

Tables - adjustable columns or merging cells

Post by kellymdeters » Thu Jan 31, 2013 4:10 pm

I created and maintain a application for students designing lab experiments. There is a data table field and in this next version I'd like to make it so that the column widths are adjustable (I can do it so they all change - but I want students to be able to widen one column without having all the rest have to match) and (less important but still a wish) that they can merge cells (like to make a title that spans multiple columns). Basically I want it to work like a table in a Word document - adjustable widths and merging capabilities.

I've never figured out how to do this in 4 versions and really want it for this one...any help is greatly appreciated! :)

Kelly Morgan Dempewolf

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

Re: Tables - adjustable columns or merging cells

Post by Klaus » Thu Jan 31, 2013 4:45 pm

Hi Kelly,

use a "datagrid" instead of a "table" field!
The datagrid comes with a built-in "column resizing" feature :D

No idea about "merging cells", sorry.


Best

Klaus

kellymdeters
Posts: 23
Joined: Wed Oct 31, 2007 9:16 pm

Re: Tables - adjustable columns or merging cells

Post by kellymdeters » Thu Jan 31, 2013 4:58 pm

Thanks!

Can the "data grid" field (which I've never used before) be easily saved in a MySQL database in a single field? That's what I use for the back-end of my application

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

Re: Tables - adjustable columns or merging cells

Post by Klaus » Thu Jan 31, 2013 5:07 pm

Hi Kelly,
kellymdeters wrote:Can the "data grid" field (which I've never used before) be easily saved in a MySQL database in a single field? That's what I use for the back-end of my application
yes, if you have a datagrid of type TABLE, which is what you probably need, then you can save its "dgtext" into one db field,
since "the dgtext of grp XYZ" is "just" CR and TAB delimited text in the end.
...
put the dgtext of grp "name of your datagrid here" into tDGText
## now store tDGText in ONE db field
...

Datagrids are complex bests with lots of features, but of type TABLE quite easy to understand. :D


Best

Klaus

kellymdeters
Posts: 23
Joined: Wed Oct 31, 2007 9:16 pm

Re: Tables - adjustable columns or merging cells

Post by kellymdeters » Thu Jan 31, 2013 5:17 pm

Thank you!

Yes, Data Grids appear very scary to me...but with your help I know which direction to head! :)

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

Re: Tables - adjustable columns or merging cells

Post by Klaus » Thu Jan 31, 2013 5:29 pm

Count on me!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: Tables - adjustable columns or merging cells

Post by bn » Thu Jan 31, 2013 6:22 pm

Hi Kelly,

maybe the modified Table Field I made is useful to you.

http://www.berndniggemann.on-rev.com/mo ... vecode.zip

It is a field with for tabular data you can adjust the column width manually by dragging the vertical dividers, also adjust column width automatically by control-clicking into the field. Various sorting options by clicking into the header line.
No right alignment for columns, no data entry. Please read the help file in the "?" button.

Kind regards
Bernd

kellymdeters
Posts: 23
Joined: Wed Oct 31, 2007 9:16 pm

Re: Tables - adjustable columns or merging cells

Post by kellymdeters » Thu Jan 31, 2013 7:10 pm

Thank you! I'll check it out!

Post Reply