Edit Event Trigger

Posted by: jgalera on 29 January 2019, 9:31 am EST

    • Post Options:
    • Link

    Posted 29 January 2019, 9:31 am EST

    Is there a way to trigger an event as you’re typing into a cell? The Edit events that currently exist seems to only handle events when the focus is added to a cell (beforeStartEditing and startEditing) and when focus is removed from the cell (beforeEndEditing, endEditing) but not when you’re typing in the cell

  • Posted 31 January 2019, 2:47 pm EST

    Hello,

    Please use below mentioned code for the same:-

    function keyDownEvent(e) {
                console.log('key down');
            }
            dataView.editing.addHandler(function (sender, args) {
                if (args.status === 'startEditing') {
    
                    var editingContainer = sender.container.querySelector('#' + sender.uid + ' .gc-editing-area');
                    editingContainer.addEventListener('keydown', keyDownEvent)
    
                } else if (args.status === 'beforeEndEditing') {
    
                } else if (args.status === 'endEditing' || args.status === 'cancelEditing') {
                    var editingContainer = sender.container.querySelector('#' + sender.uid + ' .gc-editing-area');
                    editingContainer.removeEventListener('keydown', keyDownEvent)
    
                }
    
            });
    

    Hope it helps.

    Thanks,

    Reeva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels