Any help appreciated...
I have a series of buttons, each with a mouseEnter handler. When the mouse enters a button, a field is shown near it. In that field, I want to put a value. That value is in column 2 of a data grid. In column 1 is the name of the button.
So what I _thought_ I needed to do is:
- Put the short name of the button in a global variable, then
- somewhere, create a script that tried to match that value to one of the values in column 1.
- if it matched, it would get the value in column 2, put it in a global variable, and put that into the field beside the button.
I realize (after reading posts here) that the script for getting the values of the columns had to be _inside_ the data grid group.
But now I don't know how to, from outside of that grid, trigger that script and get the value I want. I tried adding a button inside the grid group, and issuing a "click button of group..." - but that was a disaster...
Any ideas? much thanks!
mike
Getting Data Grid values - what I am doing wrong?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
I think you can use FindIndex combined with defining your own custom proeprty to accomplish what you are after.
Data Grid API
Try adding something like this to your Data Grid Group script (untested and needs you to fill in correct column names):
Once you place this code in your Data Grid group script you can access the value for a button like this:
Make sense?
Data Grid API
Try adding something like this to your Data Grid Group script (untested and needs you to fill in correct column names):
Code: Select all
getprop uButtonValue [ pButtonName ]
FindIndex NAME_OF_COL_WITH_BUTTON_NAME, pButtonName
put the result into theIndex
if theIndex > 0 then
return GetDataOfIndex( theIndex, NAME_OF_COL_WITH_VALUE)
else
return empty
end if
end uButtonValue
Code: Select all
put the uButtonValue[ BUTTON_NAME ] of group "DataGrid" into theValue
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder