wrap text in datagrid table

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
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

wrap text in datagrid table

Post by francof » Thu Aug 28, 2014 2:04 pm

Hi all,
I'm new in LC and much more in datagrid... I'm reading the LiveCode_Data_Grid.pdf guide and found out a lot of intersting things about it.

I use a datagrid table in my code, to only show some data. due to the width of the card, the colums can't show all the text of some fields.
this lesson http://lessons.runrev.com/s/lessons/m/d ... ne-heights
would seem to make my case, but it refers to a datadrid form.
I do not understand the difference between table and form datagrid. I'm not sure if I can use it.
the "Script Field to Resize to Fit Height" in the lesson refer to some item (3, 4) ?? I would not want to mess up


thanks for your help
franco

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm

Re: wrap text in datagrid table

Post by sritcp » Thu Aug 28, 2014 3:06 pm

Hi Franco:

You can set the row height of a table, but it will be the same for all rows.
You can individualize the row height in case of a form -- that was the lesson you referred to.

In a table, you control the data grid at the level of a column (you can customize a specific column by editing its behavior template).
In a form, the basic control is the row template; you cannot customize column behavior except through the row template.

When you are laying out the row template, you need to manipulate its dimensions. You do it by using its "rect".
Rect has 4 "items", corresponding to the four corners of the rectangle. These are the items that you asked about.
See dictionary for more details.

When using data grid, it's best to tread with care. Just my opinion.

Regards,
Sri

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap text in datagrid table

Post by francof » Thu Aug 28, 2014 8:32 pm

ciao Sri,
sritcp wrote:Hi Franco:

You can set the row height of a table, but it will be the same for all rows.
Yes I've set the row height of the columns but, but the display of the text is not changed.... boh
sritcp wrote:....When using data grid, it's best to tread with care. Just my opinion.

Regards,
Sri
I've already heard this claim.. :) for this I would not to use too much that object. even if it is really handy.

best
franco

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

Re: wrap text in datagrid table

Post by dunbarx » Fri Aug 29, 2014 3:03 am

Sri did not mean a dataGrid is unstable or psychotic, only that it is complex, and requires considerable effort to master. This after one is already fairly conversant with LC itself, It has its own "language" and behaviors, even though it is strictly built in LC.

Craig Newman

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap text in datagrid table

Post by francof » Fri Aug 29, 2014 8:20 am

dunbarx wrote:Sri did not mean a dataGrid is unstable or psychotic, ...
me too.
dunbarx wrote:..., and requires considerable effort to master. ...
for this I have not used yet it. it's very complex and useful. I use datagrid for the first time in the simplest way possible.

franco

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: wrap text in datagrid table

Post by keram » Fri Aug 29, 2014 11:18 am

Hi Franco,

I found that a very good way to learn to use Data Grid is to look through the existing examples.
Here you'll find few ones that I found very useful:
StarterKit and DGForms : http://forums.livecode.com/viewtopic.php?f=7&t=20130
and also: http://forums.livecode.com/viewtopic.php?f=7&t=15540
and http://forums.livecode.com/viewtopic.php?f=7&t=7865

keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap text in datagrid table

Post by francof » Fri Aug 29, 2014 6:13 pm

Hi keram,
thanks for the info. I had already consulted StarterKit, the other are new for me.

franco

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

Re: wrap text in datagrid table

Post by Klaus » Sat Aug 30, 2014 5:17 pm

Buongiorno Franco.

a datagrid of type TABLE can only display ONE line of information per column/row.
If you need more, you need to create a datagrid of type FORM.

Read and check the examples in the Datagrid PDF here:
http://lessons.runrev.com/m/datagrid


Best

Klaus

francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: wrap text in datagrid table

Post by francof » Sat Aug 30, 2014 5:47 pm

Hi Klaus,
Klaus wrote:Buongiorno Franco.

a datagrid of type TABLE can only display ONE line of information per column/row.
If you need more, you need to create a datagrid of type FORM.
...
yea, after trying for a long time, I realized that it is so. :) I prefer use the more light 'table'
I also download the Manual PDF for data grid, very useful.

thanks. ciao
franco

Post Reply