DataGrid Search, Narrow search by Column
Posted: Fri Oct 30, 2020 7:02 pm
Hi everybody ,
i am working on a project in which I want to include a search function. I found and used the following code in the forum
datagrid code
....and search button code
the problem is that I need to narrow down the search only in the first column named "NO" .
Any suggestions?
i am working on a project in which I want to include a search function. I found and used the following code in the forum
datagrid code
Code: Select all
command searchMe tString
local tIndexList, tRecord, tHLIndexes
put the dgIndexes of me into tIndexList
repeat for each item tIndex in tIndexList
put getDataOfIndex(tIndex) into tRecord
repeat for each element tElement in tRecord
if tElement contains tString then
put tIndex & comma after tHLIndexes
exit repeat
end if
end repeat
end repeat
delete the last char of tHLIndexes
set the dgHilitedIndexes of me to tHLIndexes
end searchMe
Code: Select all
on mouseUp
local tSearchString
ask "Search Term?"
if it is not empty then put it into tSearchString
dispatch "searchMe" to group "DataGrid1" with tSearchString
end mouseUp
the problem is that I need to narrow down the search only in the first column named "NO" .
Any suggestions?