Detect active cell changing when a range is selected

Posted by: lpagliaro on 17 January 2018, 2:26 pm EST

    • Post Options:
    • Link

    Posted 17 January 2018, 2:26 pm EST

    Hello. When selecting a group of cells, the active cell is the cell at the top left of the range, if I hit tab the active cell within the range changes to the next cell to the right. Is there a way to detect the active cell changing?

  • Posted 19 January 2018, 5:54 am EST

    Hello,

    You can listen to LeaveCell event to know when an active cell is changed. For example:

    
      activeSheet.bind(GC.Spread.Sheets.Events.LeaveCell, function (sender, args) {
                    console.log("The column index before moving: " + args.col);
                    console.log("The row index before moving: " + args.row);
                });
    
    
    

    If you want the information about new cell get focus, you can catch the EnterCell event:

    
     activeSheet.bind(GC.Spread.Sheets.Events.EnterCell, function (e, info) {
                    alert("Cell (" + info.row + ", " + info.col + ")");
                });
    
    

    I hope it helps.

    Thanks,

    Deepak Sharma

  • Posted 19 January 2018, 8:19 am EST

    Thanks for your help, Deepak.

    Regards.

Need extra support?

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

Learn More

Forum Channels