React Working with Commands

    The React Spreadsheet component allows you to perform commands for activating different features of the spreadsheet. This topic explains how to perform different operations with the control using commands. Many of the commands will perform their action based on the active cells, rows, or worksheets. For example two such commands are ZoomIn and ZoomOut. See the SpreadsheetAction enum for a full list.

    React Working with Commands Example

    Dependencies

    Before making use of the commands you will want to import the SpreadsheetAction

    import { IgrSpreadsheet } from 'igniteui-react-spreadsheet';
    import { SpreadsheetAction } from 'igniteui-react-spreadsheet';
    

    Usage

    The following snippet shows how you can setup the data validation rules

    public spreadsheet : IgrSpreadsheet = new IgrSpreadsheet({});
    
    // ...
    
    public zoomIn(): void {
        this.spreadsheet.executeAction(SpreadsheetAction.ZoomIn);
    }
    
    public zoomOut(): void {
        this.spreadsheet.executeAction(SpreadsheetAction.ZoomOut);
    }
    

    API References

    • ExecuteAction
    • SpreadsheetAction