Ctrl+End not functioning like Excel 365/Desktop Excel

Posted by: mwyatt on 8 June 2021, 4:46 am EST

  • Posted 8 June 2021, 4:46 am EST

    When using Ctrl+End in Excel, it takes me to the last row/column that has data in it (example, if I have data in cells L45 and R18, it will set focus on cell R45. With https://www.grapecity.com/spreadjs/designer/index.html and data in those cells it takes me to the last row/column cell T200.

    Is this a bug and if so, can it be fixed to match Excel?
  • Replied 8 June 2021, 8:20 pm EST


    For this, you need to create a custom command on the end key and add the selection accordingly to your need. for setting the active Cell you may use the setActiveCell method. Please refer to the following code and attached demo that demonstrates how we could use the custom command in spreadJS.

    var ctrlShiftEndCmd = {
    canUndo: true,
    execute: function(spread, options, isUndo) {
    var Commands = GC.Spread.Sheets.Commands;
    if (isUndo) {
    Commands.undoTransaction(spread, options);
    return true;
    } else {
    Commands.startTransaction(spread, options);
    options.cmd = 'ctrlShiftEnd';
    var sheet = spread.getSheetFromName(options.sheetName);
    //calculate the row col accounding to the requirement
    sheet.setActiveCell(row, col)
    Commands.endTransaction(spread, options);
    return true;
    let commandManager = spread.commandManager();

    customAction Demo: https://www.grapecity.com/spreadjs/demos/features/worksheet/actions/sheet-actions/purejs

Need extra support?

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

Learn More

Forum Channels