Page 1 of 1

Putting data from fields into a datagrid

Posted: Mon Aug 15, 2011 7:13 pm
by wolfkillshepard
Hello, my name is Christian

On one card a user enters data into fields, example: Company Name, First Name, Last Name, and Email. After the user enters that data into said fields, the user would hit a confirm button. When the hits the confirm button I would like the information from those fields to be put into a datagrid on a separate card.

I would like the datagrid to list the info by company name. After the user clicks on one of the rows displaying the company name, I want the user to be navigated to a card that builds all the information into it. Information being Company Name, First Name, Last Name, and Email.

Thanks everyone I appreciate the help!

Re: Putting data from fields into a datagrid

Posted: Mon Aug 15, 2011 7:59 pm
by dunbarx
Hi.

Datagrids are just complex gadgets created with ordinary objects. Go here:http://lessons.runrev.com/spaces/lesson ... s/datagrid

Chack out the dgText and dgData.

Craig Newman

Re: Putting data from fields into a datagrid

Posted: Mon Aug 15, 2011 8:03 pm
by wolfkillshepard
I'm reading through and I am having trouble grasping the concept of datagrids though the page, there's just a lot of info there.

And examples or sample code would be greatly appreciated

Re: Putting data from fields into a datagrid

Posted: Mon Aug 15, 2011 9:32 pm
by dunbarx
On a clean card, drag a new datagrid. Go to the property inspector, name it "dg1" and create a three columns. Now make a button. In the button script place:

Code: Select all

on mouseUp
   put "name" & tab & "company" & tab & "address" & return & "name2" & tab & "company2" & tab & "name2" into temp
   set the dgText of group "dg1" to temp
end mouseUp
In this simple example, it can be seen that the datagrid accepts data that is tab and return delimited. You should be able to empty the datagrid and should also be able to modify the code so that you can do whatever you need to. But write back as often as you want...

Craig Newman

Re: Putting data from fields into a datagrid

Posted: Mon Aug 15, 2011 10:11 pm
by wolfkillshepard
Thanks for the help, that clears up a lot.

I have a couple more questions

Could I make it so that when I click a individual row in the data grid it will take me to a new card and populate fields in it based on the data that one row contains?

What would the code look like specifying one row out of a whole datagrid?

Re: Putting data from fields into a datagrid

Posted: Tue Aug 16, 2011 8:35 am
by BarrySumpter
Not tested by me as yet:


How-Do-I-Get-Data-Associated-With-a-Row-or-Column-
http://lessons.runrev.com/spaces/lesson ... or-Column-