dgHilitedLine
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
dgHilitedLine
I think I'm right in saying that if I set the dgHilitedLine of a datagrid in a script it does NOT cause a selectionChanged message to be generated. Is there a way to change that behavior? The selection did change after all.
Thanks,
Pete
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: dgHilitedLine
That is correct and it is the intended behavior. This is how selectionChanged works with list fields as well. The docs for selectionChanged explain that it is a message sent when the user makes a change.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: dgHilitedLine
Thanks, just checking if there was a way to change that behavior.
Pete
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: dgHilitedLine
You could define your own custom property in the data grid that does what you want. Something like this in the data grid group script might do the trick:
Code: Select all
setProp myDgHilitedLine pLine
put the dgHilitedLine of me into theOrigLineNo
set the dgHilitedLine of me to pLine
dispatch "selectionChanged" to me with pLine, theOrigLineNo
end myDgHilitedLine
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
Re: dgHilitedLine
Thanks Trevor, I will try that.
Another thing in your example that is very useful to me is that the selectionChanged message has two parameters when it comes from a datagrid! There's no mention of that in the dictionary, although the dictionary doesn't even mention datagrids in it's description of selectionChanged. I see it does mention it in the Datagrid Manual, I wish I had consulted that insetad of the dictionary!
Thanks,
Pete
Another thing in your example that is very useful to me is that the selectionChanged message has two parameters when it comes from a datagrid! There's no mention of that in the dictionary, although the dictionary doesn't even mention datagrids in it's description of selectionChanged. I see it does mention it in the Datagrid Manual, I wish I had consulted that insetad of the dictionary!
Thanks,
Pete
-
- VIP Livecode Opensource Backer
- Posts: 1005
- Joined: Sat Apr 08, 2006 3:06 pm
- Contact:
Re: dgHilitedLine
Yeah, the dictionary doesn't have any info on the Data Grid. You should consult the manual at http://lessons.runrev.com for the latest information.
Trevor DeVore
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
ScreenSteps - https://www.screensteps.com
LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder