Page 1 of 1

Key listener on Data Grid web component

PostPosted: Thu Sep 23, 2021 7:00 am
by roddy
I am trying to get the callback to fire on a Data Grid web component; the keylistener attribute has been added to the properties and linked to the plugins.keyListener.addKeyListener() in the onShow().

It is working on a field in a form that has a similar setup; can it also work for other components in intercepting key strokes as above?

Re: Key listener on Data Grid web component

PostPosted: Thu Sep 23, 2021 9:45 am
by Gabi Boros
where do you want to put the keylistener? on the component? so when focused you can handle a key event or on an editing cell of the grid? (cell editor)

Re: Key listener on Data Grid web component

PostPosted: Mon Sep 27, 2021 12:48 am
by roddy
Ideally, we want keyboard shortcuts for the app. I am trying to add the key listener to the onShow() of a form (with the keylistener attribute on the form).

This is not necessarily about focus; for example, we are using the svy Navigation side bars and nav bar, the up and down arrows work on a list form but only when it is clicked on to set the focus. I couldn't find any way of setting (or requesting) the focus to anything except a field, so there was no way I could find to set the focus to the form. We would also like the Enter key to select a record on a list; pressing Enter does not currently do anything.

So, the upshot is being able to get the key listener to work on a form component, so we can implement the keyboard shortcuts requested for the Servoy app.

Re: Key listener on Data Grid web component

PostPosted: Mon Sep 27, 2021 9:48 am
by Gabi Boros
can't you just use the shortcut api from the window plugin for this?

Re: Key listener on Data Grid web component

PostPosted: Tue Sep 28, 2021 8:30 am
by roddy
I had no idea this functionality existed, thanks for passing it on. Will give it a go :-)