Grid messages

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
johnkane
Posts: 9
Joined: Sun Nov 06, 2011 1:06 am

Grid messages

Post by johnkane » Sun Nov 06, 2011 2:52 am

How do you validate data entered in a cell of a grid?

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

Re: Grid messages

Post by dunbarx » Mon Nov 07, 2011 5:11 am

Hi.

When you say "validate", do you mean to check beforehand whether the data to be entered is a number, say, or perhaps a date, so that later functionality can expect to see the data in a format that will not generate an error?

How is your data entered? is it via an editable field in a datagrid or table field? Or is it via an "ask" dialog or somesuch?

The methods to check are different. In the first instance, you must check the data via messages that are sent either during typing or after closing a field or cell. In the second, you can validate under script control before the data is actually loaded.

Write back with details. You will get answers almost instantly.

Craig Newman

johnkane
Posts: 9
Joined: Sun Nov 06, 2011 1:06 am

Re: Grid messages

Post by johnkane » Mon Nov 07, 2011 7:30 pm

If I can get a message that a cell is being closed and replace its contents with validated data, that would be ideal. I don't see any message -- like a closefield -- for a cell (close cell?)

I am fairly new to livecode, but have a lot of experience in the past with HyperCard/SuperCard/Toolbook

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Grid messages

Post by mwieder » Mon Nov 07, 2011 8:58 pm

John - welcome to the forum.

When you say "grid" are you talking about a datagrid control?

Update: and if so, you might want to check out the following lessons. The datagrid is a pretty specialized control and acts a bit differently from other controls (it's actually a group of groups with a behavior library).

http://lessons.runrev.com/s/lessons/m/d ... r-Editing-
http://lessons.runrev.com/s/lessons/m/d ... -Behavior-
http://lessons.runrev.com/s/lessons/m/d ... a-Grid-API

Post Reply