My stack contains an option menu with a few (less than 10) dynamic entries. All these entries also exist in a datagrid in the same stack. The datagrid may have dozens of rows. What I am trying to achieve is that my selection from the option menu works as a filter for the datagrid, meaning that the datagrid gets updated by showing only the rows that contain the selection from the option menu.
The handler below works in LiveCode, but not in my standalone.
Code: Select all
on menuPick pItemName
put label of btn "Option menu" into myLabel
send mouseup to btn "Reload" -- this populates a data grid
put false into firstLineContainsHeaders
put the dgText [firstLineContainsHeaders] of group "DataGrid" into myAll
repeat with x = 1 to the number of lines of myAll
if word 1 of line x of myAll is myLabel then
put line x of myAll & return after myList
end if
end repeat
set the dgText [firstLineContainsHeaders] of group "DataGrid" to myList
end menuPick