DataGrid Cells and Behaviors

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
Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

DataGrid Cells and Behaviors

Post by Simon Knight » Sat May 21, 2011 1:42 pm

Hi,
I am seeking advice on the best way to create a table of data using LiveCode. I need two tables each of 50 rows by 12 columns (i.e not very large). Each cell needs to be associated with a database key and have several encode / decode routines attached or associated. At present my stack files have the encode/decode routines written as a behaviour script. I have edit fields that use the behavior script and have custom properties that hold the database key. My first though was to use a DataGrid but having watched a tutorial video it seems that the individual cell behavior scripts are already used by the datagrid itself. Am I correct and should I be looking to design my own custom table like control?

Thanks

Simon
best wishes
Skids

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: DataGrid Cells and Behaviors

Post by townsend » Sat May 21, 2011 8:01 pm

Here's a little example Stack that should get you started.
It's almost done. The only part that is missing is the Update.
I'll post that as well, as soon as I get that figure out.

Image
Each button calls a Handler. All the Handlers are together in the Stack area.
Attachments
CRUD_SQLite_example_v3.zip
(7.03 KiB) Downloaded 242 times

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: DataGrid Cells and Behaviors

Post by Simon Knight » Tue May 24, 2011 10:01 am

Thanks for the example stack - I'm am progressing forwards slowly with datagrids.

best wishes

Simon
best wishes
Skids

townsend
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 430
Joined: Sun Feb 13, 2011 8:43 pm

Re: DataGrid Cells and Behaviors

Post by townsend » Tue May 24, 2011 6:59 pm

Okay. I finally finished this example! I added the
Update Row in DB Handler. It's very tight code.
Everything done just right-- as best as it can be.

This way, when I copy code, out of here, into my
future projects I'll be starting with a solid foundation.

All the buttons call Handlers in the Main Stack. This way
all the code is in one place, AND if this were going to
be deployed for different screen sizes, all buttons would
call the same Handlers-- thus-- button code would not
need to be copied from one to another.
101 CRUD SQLite 3.2.JPG
101 CRUD SQLite 3.2.JPG (56.28 KiB) Viewed 4136 times
Attachments
CRUD_SQLite_example_v3.2.zip
(8.9 KiB) Downloaded 284 times

Post Reply