SpreadJS 13
GC.Spread.Sheets Namespace / Events type / RangeSorting Event
The sheet that triggered the event.
The sheet's name.
The index of the column to be automatically sorted.
Whether the automatic sort is ascending.
Whether the operation should be canceled.
The range of automatic sort.
The groupSort level to use when sorting, default will use group level if contains group and use flat level if not contains group.
Whether to ignore the hidden values and only sort visible values.
The customize function to use when sorting, used when value sort. function (value1, value2) {return 0;}
In This Topic
    RangeSorting Event
    In This Topic
    Occurs when a column is about to be automatically sorted.
    Syntax
    var instance; // Type: Events
    instance.RangeSorting = function(sheet,
                                     sheetName,
                                     col,
                                     ascending,
                                     cancel,
                                     range,
                                     groupSort,
                                     ignoreHidden,
                                     compareFunction) { };
    RangeSorting = function ( 
       sheet : Worksheet,
       sheetName : string,
       col : number,
       ascending : boolean,
       cancel : boolean,
       range : Range,
       groupSort : groupSort,
       ignoreHidden : boolean,
       compareFunction : Function
    ) { };

    Parameters

    sheet
    The sheet that triggered the event.
    sheetName
    The sheet's name.
    col
    The index of the column to be automatically sorted.
    ascending
    Whether the automatic sort is ascending.
    cancel
    Whether the operation should be canceled.
    range
    The range of automatic sort.
    groupSort
    The groupSort level to use when sorting, default will use group level if contains group and use flat level if not contains group.
    ignoreHidden
    Whether to ignore the hidden values and only sort visible values.
    compareFunction
    The customize function to use when sorting, used when value sort. function (value1, value2) {return 0;}
    Example
    This example uses the RangeSorting event.
    activeSheet.setValue(0, 0, 10);
    activeSheet.setValue(1, 0, 100);
    activeSheet.setValue(2, 0, 50);
    activeSheet.setValue(3, 0, 40);
    activeSheet.setValue(4, 0, 80);
    activeSheet.setValue(5, 0, 1);
    activeSheet.setValue(6, 0, 65);
    activeSheet.setValue(7, 0, 20);
    activeSheet.setValue(8, 0, 30);
    activeSheet.setValue(9, 0, 35);
    var cellrange =new GC.Spread.Sheets.Range(0, 0, 5, 1);
    var hideRowFilter =new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);
    activeSheet.rowFilter(hideRowFilter);
    
    activeSheet.bind(GC.Spread.Sheets.Events.RangeSorting, function (e, info) {    
            alert("Col (" + info.col + ", " + info.ascending +")");
    });
    See Also

    Reference

    Events type