Delete value on cell doesn't trigger any event

Posted by: davide.vago on 23 August 2019, 1:35 am EST

  • Posted 23 August 2019, 1:35 am EST

    Good morning/afternoon

    Working on the events triggered by the user on top of a spreadsheet instance. I found that the event of deleting the value of a cell using the ‘return’ of the keyboard doesn’t trigger any event.

    I’m currently using EditEnded but I also tried EditChange, ValueChanged, CellChanged and I don’t see any logs coming out on the dev console.

    Am I doing something wrong or that’s a bug?

    Thanks in advance for your support.

  • Posted 25 August 2019, 5:38 pm EST

    Hi Davide,

    We are sorry but we are unable to replicate the issue at our end. In our tests, clearing value using the return key fires cell changed and value changed events as expected. Following is the sample we used for testing purposes, please have a look at it and let us know if there are any additional steps to reproduce the issue:

    Further, if you were trying to handle the event fired when cells are cleared using the delete key, then you may handle the RangeChanged event. Please refer to the following code snippet:

    spread.bind(GC.Spread.Sheets.Events.RangeChanged, function(sender, args) {
        if (args.action === GC.Spread.Sheets.RangeChangedAction.clear) {
          console.log("cells clear action");
        }
      });
    

    Regards

  • Posted 13 November 2022, 10:55 pm EST - Updated 13 November 2022, 11:00 pm EST

    Im also having this problem. It arises when not the content but the whole cell is deleted using this menu option:

  • Posted 14 November 2022, 6:02 pm EST

    Hello Jelena,

    To detect events when the delete operation is performed from the SpreadJS Designer, you could use the commandManager’s appListener method. Please see the following code example:

    spread.commandManager().addListener("appListener", function(info) {
        if(info.command) {
            let command = info.command;
            let commandName = command.cmd;
            let sheetName = command.sheetName;
            let selections = command.selections;
            switch(commandName) {
                case "Designer.deleteLeftCells":
                case "Designer.deleteRows":
                case "Designer.deleteColumns": 
                case "Designer.deleteSheet":
                    console.log("Command Name: " + commandName);
                    console.log("Sheet Name: " + sheetName);
                    console.log("Selections: ");
                    console.log(selections);
                default:
                    break;
            }
        }
    })

    Sample: https://jscodemine.grapecity.com/share/6fg2GbhsxEmx98_wk3xghA/

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels