PDA

View Full Version : multiple Keylistener on a Grid



ishak1981
23 Aug 2011, 4:32 AM
How can I add a multiple Keylistener like STGR+A on a Grid?
I tried with
personGrid.addListener(KeyNav.getKeyEvent(),
new Listener<GridEvent<BeanModel>>() {
if(be.getKeyCode()==17 && be.getKeyCode()==65)
...
, but it didn't work.

Thanks.
Isak

slemmon
23 Aug 2011, 9:33 AM
What is STGR?

skirtle
23 Aug 2011, 8:42 PM
I assume you mean STRG rather than STGR. Strg is short for Steuerung, German for control.

It looks like you're using Ext GWT. This forum is for ExtJS 4, there is a separate forum for Ext GWT.

In ExtJS you could check for Ctrl+A with something like this:


if (ev.getKey() === ev.A && ev.ctrlKey) {
...
}

Here ev.A is just a constant equal to 65.