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

    EXAMPLE
    DATA
    TSX

    Like this sample? Get access to our complete Ignite UI for React toolkit and start building your own apps in minutes. Download it for free.

    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';
    ts
    Ignite UI for React | CTA Banner

    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);
    }
    ts

    API References

    • ExecuteAction
    • SpreadsheetAction