have tried my best to search/read/experiment but can’t get this to work.
I have stored a database cursor as an array in a custom property of a data grid - call this ‘AllLines’ of data grid ‘datagrid’.
Works well for displaying all items, but i want be able to filter this, and would prefer not to continuously query the database unless needed.
I can’t seem to select out the array items i need however.
My code passes the text to filter on to a switch statement, but I’m obviously not doing it right… the command is:
Code: Select all
Command filterList pFilter
switch pFilter
case "All"
set the dgData of group “datagrid” to (the AllLines of group "datagrid")
break //THIS WORKS AS EXPECTED
Case “xyz”
put the AllLines of group "datagrid" into tArray
repeat for each item tArr in tArray
if tArr[“key”] = “xyz” then //key is the name of the field to compare with pFilter
put tArr into tSelected
end if
end repeat
set the dgData of group “datagrid” to tSelected //NOTHING HAPPENS
break
end switch
end command
Very grateful if someone can point me in the right direction…