Looking for datagrid multi line selection advice
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Looking for datagrid multi line selection advice
In order to select specific lines or multiple lines, you need as far as i know to hold either control or shift on the keyboard. On a windows tablet this is doable, but only with the keyboard visible. This hides half the app. Is there anyway to do it without the keyboard? Can I create a button or check box to do the same thing as holding control or shift? If so, how? Any help would be greatly appreciated.
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Looking for datagrid multi line selection advice
Hi. In a button script:
Check out the DG API for all these gadgets.
Craig Newman
Code: Select all
on mouseUp
set the dgHilitedLines of grp "yourDG" to "2,3"
end mouseup
Craig Newman
Re: Looking for datagrid multi line selection advice
Hi Craig,
I'm afraid this solution might require a (too) great portion of "clairvoyance"...dunbarx wrote: ↑Mon Feb 12, 2018 6:09 pmHi. In a button script:Check out the DG API for all these gadgets.Code: Select all
on mouseUp set the dgHilitedLines of grp "yourDG" to "2,3" end mouseup
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Looking for datagrid multi line selection advice
Klaus.
The "API" part or the handler? If the API, I get it. If the handler, and one should set the "multi Row Hilites" to true, of course, I do not.
I am posting because I know you a little and under what conditions you toss in:
Craig
The "API" part or the handler? If the API, I get it. If the handler, and one should set the "multi Row Hilites" to true, of course, I do not.
I am posting because I know you a little and under what conditions you toss in:
Craig
Re: Looking for datagrid multi line selection advice
Hi Craig,
I meant that setting the dghilitedlines by script is surely easy, but the hard part is to catch all the "touches" on mobile for selecting a row without a shift key and THEN set the dghilitedlines accordingly.
After all it was just a joke, with a tiny element of truth.
Best
Klaus
I meant that setting the dghilitedlines by script is surely easy, but the hard part is to catch all the "touches" on mobile for selecting a row without a shift key and THEN set the dghilitedlines accordingly.
After all it was just a joke, with a tiny element of truth.
Best
Klaus
Re: Looking for datagrid multi line selection advice
Thank you for the help, I got the following to work.
Shift Button
DataGrid
Shift Button
Code: Select all
on mouseUp
if the backgroundcolor of me is blue then
set the backgroundcolor of me to empty
set the textcolor of me to black
put empty into allLines
else
Set the backgroundcolor of me to blue
set the textcolor of me to white
set the backgroundcolor of btn "Ctrl" to empty
set the textcolor of btn "Ctrl" to black
end if
end mouseUp
Code: Select all
if the backgroundcolor of btn "Shift" is blue then
if allLines is not a number then
put empty into allLines
end if
put the dgHilitedLines of group "DataGrid 7" into newLine
If allLines is empty then
put newLine into allLines
else
put allLines into newNumber
if allLines > newLine then
put allLines - newLine into newLines
repeat newLines times
put newNumber - 1 into newNumber
put newNumber & comma before allLines
put newLines - 1 into newLines
end repeat
else
put newLine - allLines into newLines
repeat newLines times
put newNumber + 1 into newNumber
put comma & newNumber after allLines
put newLines - 1 into newLines
end repeat
end if
end if
set the dgHilitedLines of grp "DataGrid 7" to allLines
end if
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här