Page 1 of 1

Data grid not updating?

Posted: Thu Jan 02, 2014 10:18 pm
by Hex
Hey all, I am trying to make it so when you push a button it updates the data grid with text from a text field.

Code: Select all

on mouseUp
   put the dgDataOfLine[2] of group "DataGrid 1" into theArray["R"]
   put the text of field "Rfld" into theArray["R"]
   set the dgDataOfLine[2] of group "DataGrid 1" to theArray["R"]
end mouseUp
This just clears the data in its place instead. Any thoughts on how to fix that? Thanks!

Re: Data grid not updating?

Posted: Thu Jan 02, 2014 11:25 pm
by Klaus
Hi Hex,

1. welcome to the forum! :D

2. -> the dgDataOfline[X] = a multidimensional array!
So you need to do something like this to only fill the KEY named "R" (name of column?)
of that array, if that is what you want:

Code: Select all

on mouseUp
   put the dgDataOfLine[2] of group "DataGrid 1" into theArray
   put the text of field "Rfld" into theArray["R"]
   set the dgDataOfLine[2] of group "DataGrid 1" to theArray
end mouseUp
Best

Klaus

Re: Data grid not updating?

Posted: Thu Jan 02, 2014 11:37 pm
by Hex
Oh I see, that makes sense! Thanks for the help!