SpreadJS 13
GC.Spread.Sheets Namespace / Events type / TopRowChanged Event
The sheet that triggered the event.
The sheet's name.
The old top row index.
The new top row index.
In This Topic
    TopRowChanged Event
    In This Topic
    Occurs when the top row changes.
    Syntax
    var instance; // Type: Events
    instance.TopRowChanged = function(sheet, sheetName, oldTopRow, newTopRow) { };
    TopRowChanged = function ( 
       sheet : Worksheet,
       sheetName : string,
       oldTopRow : number,
       newTopRow : number
    ) { };

    Parameters

    sheet
    The sheet that triggered the event.
    sheetName
    The sheet's name.
    oldTopRow
    The old top row index.
    newTopRow
    The new top row index.
    Example
    This example synchronizes vertical and horizontal scrolling for sheet 1 and sheet 2.
     var sheet1 = spread.getSheet(0),
      sheet2 = spread.getSheet(1);
    
    sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function (sender, args) {
        //Set the displayed top row of sheet1 to sheet2 (vertical scroll synchronization).
        sheet2.showRow(args.newTopRow, GC.Spread.Sheets.VerticalPosition.top);
    });
    
    sheet1.bind(GC.Spread.Sheets.Events.LeftColumnChanged, function (sender, args) {
        //Set the displayed left column of sheet1 to sheet2 (Horizontal scroll synchronization).
        sheet2.showColumn(args.newLeftCol, GC.Spread.Sheets.HorizontalPosition.left);
    });
    See Also

    Reference

    Events type