I am building a user interface that includes two DataGrid form components in a card. I would like to use "on arrowKey" at the card level to trigger some specific actions. However, whenever the user hits an arrow Up or Down, the DataGrid component also acts on the message (by highlighting the previous or next row). I would like to disable / intercept / override this arrow action on the DataGrid.
I have tried a couple things, without success.
1) I put an "on arrowKey" handler on the Group that contains the DataGrid with a script line of 'pass arrowKey'
2) I put an "on arrowKey" handler on the Group that contains the DataGrid with a script line of 'send "arrowKey pKey" to the current card"
While I'd hoped these would handle the message and prevent it from being handled by the DataGrid, they did nothing. The DataGrid continues to move previous row or next row when the Up/Down arrow keys are pressed.
Any suggestions on how I can override the arrow key behavior on DataGrid forms?
Thank you!!
Override arrow action on DataGrid controls
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Override arrow action on DataGrid controls
Hi webmaster,
datagrids have a set of their own commands, so add this "dummy" handler to the script of the datagrid group:
Tested and works!
Best
Klaus
datagrids have a set of their own commands, so add this "dummy" handler to the script of the datagrid group:
Code: Select all
on dgarrowkey tKey
##
end dgarrowkey
Best
Klaus
Re: Override arrow action on DataGrid controls
Thanks Klaus!! Your solution works great.
I double checked and the "dgarrowKey" command isn't in the LiveCode directory. Is there some way I should submit that as a documentation 'bug' ... or is there already a list somewhere of all the special/secret DataGrid commands.
Again, thanks!
I double checked and the "dgarrowKey" command isn't in the LiveCode directory. Is there some way I should submit that as a documentation 'bug' ... or is there already a list somewhere of all the special/secret DataGrid commands.
Again, thanks!
Re: Override arrow action on DataGrid controls
My pleasure!
Not sure this is a bug, since all the gazillion Rev specific functions/commands
are also not listed in the dictionary. Remember: LC is written in LC!
I peeped into the datagrid library the "Tools/Toolset/libraries" subfolder of LC.
Not sure this is a bug, since all the gazillion Rev specific functions/commands
are also not listed in the dictionary. Remember: LC is written in LC!
I peeped into the datagrid library the "Tools/Toolset/libraries" subfolder of LC.
Re: Override arrow action on DataGrid controls
You can also list all LC stacks in the project browser to peep their scripts etc., select "Show IDE Stacks in Lists" from menu "View"
Beware, there are a LOT of them!
Beware, there are a LOT of them!