Our blazing fast Grid component built with pure JavaScript


Post by henrique »

Is it possible to have hotkeys on the triggers in the fields?


Post by alex.l »

Not supported build-in, but you can listen to DOM keydown/keypress events and handle it yourself.
https://bryntum.com/docs/gantt/api/Core/widget/Field#event-paint
https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event

All the best,
Alex


Post by henrique »

It would be interesting to have the possibility to configure this, without having to do something outside the components.


Post by mats »

We have this ticket open to look into this: https://github.com/bryntum/support/issues/4313


Post by Animal »

This is already supported.

Triggers are fully fledged widgets. So they do have that currently undocumented keyMap config.

You can override the default triggers in any field to add mappings.


Post by Animal »

As an example:

myCombo.triggers.expand.keyMap = { 'Ctrl+E' : 'onClick' };
myCombo.on('keydown', 'onFieldKeyDown', myCombo.triggers.expand);

So then control+E (CMD+E on Mac) will open the combo's dropdown.


Post by Animal »

or if you want to configure it in. Here I'm reconfiguring the resource combo in the eventEdit feature

    features : {
        eventEdit : {
            items : {
                resourceField : {
                    triggers : {
                        expand : {
                           key : 'Ctrl+E'
                        }
                    }
                }
            }
        }
    }

Post Reply