put the dgHilitedLines of group "DataGrid 7" into theLineS

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
DavJans
Posts: 273
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

put the dgHilitedLines of group "DataGrid 7" into theLineS

Post by DavJans » Fri Apr 27, 2018 6:18 pm

I'm having a problem with this grabbing the correct amount of lines but but not the correct lines. This only occurs if the data has been sorted by a column. of no sorting is done the correct lines are selected. Is there any way to fix this issue?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

DavJans
Posts: 273
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

Re: put the dgHilitedLines of group "DataGrid 7" into theLineS

Post by DavJans » Fri Apr 27, 2018 8:01 pm

I deleted the datagrid and recreated it. I still have the same problem.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

DavJans
Posts: 273
Joined: Thu Dec 12, 2013 4:21 pm
Location: Spokane, WA USA

Re: put the dgHilitedLines of group "DataGrid 7" into theLineS

Post by DavJans » Fri Apr 27, 2018 8:16 pm

I fixed it but I don't understand why it didn't work in the first place.

I replaced this code:

Code: Select all

put the dgData of group "DataGrid 7" into theDataA
put the dgHilitedLines of group "DataGrid 7" into theIndexes
put empty into tData
repeat for each item theIndex in theIndexes
if tData is empty then
put theDataA[theIndex]["id"] & "," & theDataA[theIndex]["attempt"] & "," & theDataA[theIndex]["fit_Pass_Fail"] & "," & theDataA[theIndex]["weld_Pass_Fail"] into tData
put cr & theDataA[theIndex]["id"] & "," & theDataA[theIndex]["attempt"] & "," & theDataA[theIndex]["fit_Pass_Fail"] & "," & theDataA[theIndex]["weld_Pass_Fail"] after tData
end if
end repeat
With this code:

Code: Select all

put the dgHilitedLines of group "DataGrid 7" into theLineS  --grabs hilited line
put empty into tData
repeat for each item tLine in theLineS
put the dgDataOfLine[tLine] of group "DataGrid 7" into theDataA
if tData is empty then
put theDataA["id"] & "," & theDataA["attempt"] & "," & theDataA["fit_Pass_Fail"] & "," & theDataA["weld_Pass_Fail"] into tData
else
put cr & theDataA["id"] & "," & theDataA["attempt"] & "," & theDataA["fit_Pass_Fail"] & "," & theDataA["weld_Pass_Fail"] after tData
end if
end repeat
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”