Data grid not updating?

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
Hex
Posts: 2
Joined: Thu Jan 02, 2014 10:08 pm

Data grid not updating?

Post by Hex » Thu Jan 02, 2014 10:18 pm

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!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Data grid not updating?

Post by Klaus » Thu Jan 02, 2014 11:25 pm

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

Hex
Posts: 2
Joined: Thu Jan 02, 2014 10:08 pm

Re: Data grid not updating?

Post by Hex » Thu Jan 02, 2014 11:37 pm

Oh I see, that makes sense! Thanks for the help!

Post Reply