Page 1 of 1

Data Grid - getting current line data

Posted: Mon Feb 15, 2010 11:23 am
by PeterJ
I am starting out with Revolution and I want to use Data Grids with a mySQL database. I have created a data grid on a card and put the following into the data grid group:
getProp uSelectedID
put the dgHilitedLines of me into theLine
put the dgDataOfLine[theLine] of me into myArray
put myArray["SuitcaseName"] into myAmount
return myAmount
end uSelectedID
Looking at the values in debug, I get a value of 2 for theLine, but myArray remains blank.

I assume that I have missed something somewhere, but what?

Any help would be appreciated.

Re: Data Grid - getting current line data

Posted: Mon Feb 15, 2010 3:26 pm
by trevordevore
Your code looks right. If you print off the data in the Data Grid what does it look like?

How Can I See What The Data Grid's Internal Array Currently Looks Like?

Re: Data Grid - getting current line data

Posted: Mon Feb 15, 2010 5:08 pm
by PeterJ
Thanks.

I have printed the contents and saw my mistake - I was not using the correct name for the field (I was using the column header as displayed rather than the column name!) What put me off the track of finding this was that the variables pane in debug mode was showing myArray a empty.

1
SCColour: `Black`
SCID: `1`
SCMake: `Tumi`
SCName: `Large Suiter`
2
SCColour: `Grey`
SCID: `2`
SCMake: `Delsey`
SCName: `Medium Suiter`
3
SCColour: `Grey`
SCID: `3`
SCMake: `Delsey`
SCName: `Small Suiter`


Again thanks for your help - I will press on with my learning.