Ctrl+Shift+End highlights all row/columns cells to the right and down

Posted by: mwyatt on 8 June 2021, 5:32 am EST

  • Posted 8 June 2021, 5:32 am EST

    Ctrl+Shift+End highlights all row/columns cells to the right and down to the end of the table. In Excel it only highlights row/column cells to the right and down that contain data only.
    Example. If I text in cells R18 and L45, put focus on L17 and press Ctrl+Shift+End. Attached image of the selected cells in Excel
  • Replied 8 June 2021, 7:29 pm EST

    Hi,

    For this, you need to create a custom command on the end key and add the selection accordingly to your need. for adding the selection you may use the addSelection 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);
    sheet.clearSekecions();
    //calculate the row col rowCount and colCount accounding to the need
    sheet.addSelections(row,col rowCount, colCount)
    sheet.repaint();
    Commands.endTransaction(spread, options);
    return true;
    }
    }
    };
    let commandManager = spread.commandManager();
    commandManager.register(
    'ctrlShiftEnd',
    ctrlShiftEndCmd,
    35,
    true,
    true,
    false
    );


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

    Regards,
    Avinash
Need extra support?

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

Learn More

Forum Channels