Using a DataGrid as a simple list control
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Using a DataGrid as a simple list control
Simon.
Are you sure the textHeight is not empty? Know that in a newly created field, properties such as textHeight and lineHeight are empty unless you set them explicitly.
Craig
Are you sure the textHeight is not empty? Know that in a newly created field, properties such as textHeight and lineHeight are empty unless you set them explicitly.
Craig
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Using a DataGrid as a simple list control
I think they were populated but there again I'm getting some odd errors: the simple line Go to card 1 throws an error two restarts out of three.
best wishes
Skids
Skids
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Using a DataGrid as a simple list control
Hi.
Populating a field does not explicitly give it those properties. Make a new field. In msg, write:
You will get an error about dividing by 0. Actually, dividing by empty.
Not sure what to say about not being able to navigate. Maybe you have no card 1?
Craig
Populating a field does not explicitly give it those properties. Make a new field. In msg, write:
Code: Select all
answer 5 / the textHeight of last field
Not sure what to say about not being able to navigate. Maybe you have no card 1?
Craig
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Using a DataGrid as a simple list control
Ah that will be it, my cards are numbered with letters
A tech question about table fields if I may. Is it good practise to hide a column in a table by setting the table's tabstop property so that the column has the same value as the previous column e.g. 75,75,105,225 will hide column two?
A tech question about table fields if I may. Is it good practise to hide a column in a table by setting the table's tabstop property so that the column has the same value as the previous column e.g. 75,75,105,225 will hide column two?
best wishes
Skids
Skids
Re: Using a DataGrid as a simple list control
Not on a dev machine at the moment, so might have this wrong, but my understanding is that tab stop sets the columns width, so any number represents a width, ie. 75,75,105,225 will make column two 75 pixels wide. If you wanted to hide the second column, I think it would be done using 0 or 1 like this - 75,0,105,225
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Using a DataGrid as a simple list control
The tabStops are set up so that each item depicts a fixed pixel value.
If you have "75,150,160" you will see a stop at those three xLocs.
However, if you have a fourth or subsequent stops, LC will take the difference of the last two explicit ones (160 - 150 = 10), and the later stops will all appear at that interval. So if you had more stops, they would appear at 170, 180, etc.
Craig
If you have "75,150,160" you will see a stop at those three xLocs.
However, if you have a fourth or subsequent stops, LC will take the difference of the last two explicit ones (160 - 150 = 10), and the later stops will all appear at that interval. So if you had more stops, they would appear at 170, 180, etc.
Craig
Re: Using a DataGrid as a simple list control
Ok, was finally able to fire up the dev stuff, I was kinda right (0 does not work, 1 certainly does).
@Simon - The dictionary has a lot more interesting info in properties/tabstops.
@Craig - That was interesting to find out, I didn't know it. @Simon - The dictionary has a lot more interesting info in properties/tabstops.
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Using a DataGrid as a simple list control
Thanks all however my question was one of good practise when using a table field. In the past (draw up a sandbag!) you had to do some maths to enter the correct settings either by code using the tabstops command or entry via the inspector. For example say I wanted columns of 20, 30 , 50 and 10 pixels width I would have to enter tabstops of 20,50,100,110 i.e. the distance from the left margin.
At some point in the past LC was updated and the tabwidths command was added. This command (tabwidths) allows the tabs to be set as column widths i.e. 20,30,50,10 in the example.
At the same time they also changed how tabstops accepts data. It works as described above until a value is entered that would in effect place the tab to the left of the previous one e.g.If I enter 10,20,50,10 it changes the entry to 10,20,50,60 giving column widths of 10,10,30,10 pixels.
To hide a column I enter a column width of 0 using tabwidths or if for example I use tabstops I enter 10,20,20,60 this will mean that the third column is hidden as it is the same position as the previous tabstop. My question is is this a good idea - will it cause problems with the hidden data in the column?
At some point in the past LC was updated and the tabwidths command was added. This command (tabwidths) allows the tabs to be set as column widths i.e. 20,30,50,10 in the example.
At the same time they also changed how tabstops accepts data. It works as described above until a value is entered that would in effect place the tab to the left of the previous one e.g.If I enter 10,20,50,10 it changes the entry to 10,20,50,60 giving column widths of 10,10,30,10 pixels.
To hide a column I enter a column width of 0 using tabwidths or if for example I use tabstops I enter 10,20,20,60 this will mean that the third column is hidden as it is the same position as the previous tabstop. My question is is this a good idea - will it cause problems with the hidden data in the column?
best wishes
Skids
Skids
-
- VIP Livecode Opensource Backer
- Posts: 7210
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Using a DataGrid as a simple list control
It shouldn't cause any problems at all, the hidden tabs were created specifically to address what you want to do - - keep the data without displaying it so that scripts can work with it but the user never sees it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Posts: 845
- Joined: Wed Nov 04, 2009 11:41 am
- Location: Gunthorpe, North Lincs, UK
Re: Using a DataGrid as a simple list control
Hi Jacque,
Thanks for the confirming its o.k.
Thanks for the confirming its o.k.
best wishes
Skids
Skids