SpreadJS 13
GC.Spread.Sheets Namespace / Events type / SlicerChanged Event
The sheet that triggered the event.
The sheet's name.
The slicer that triggered the event.
The name of the slicer's property that has changed.
In This Topic
    SlicerChanged Event
    In This Topic
    Occurs when any slicer has changed.
    Syntax
    var instance; // Type: Events
    instance.SlicerChanged = function(sheet, sheetName, slicer, propertyName) { };
    SlicerChanged = function ( 
       sheet : Worksheet,
       sheetName : string,
       slicer : Slicer,
       propertyName : string
    ) { };

    Parameters

    sheet
    The sheet that triggered the event.
    sheetName
    The sheet's name.
    slicer
    The slicer that triggered the event.
    propertyName
    The name of the slicer's property that has changed.
    Example
    This example uses the SlicerChanged event.
    //create a table
    datas = [
        ["1", "NewYork", "1968/6/8", "80", "180"],
        ["4", "NewYork", "1972/7/3", "72", "168"],
        ["4", "NewYork", "1964/3/2", "71", "179"],
        ["5", "Washington", "1972/8/8","80", "171"],
        ["6", "Washington", "1986/2/2", "89", "161"],
        ["7", "Washington", "2012/2/15", "71", "240"]];
    var table = activeSheet.tables.addFromDataSource("table1", 2, 2, datas);
    dataColumns = ["Name", "City", "Birthday", "Weight", "Height"];
    table.setColumnName(0, dataColumns[0]);
    table.setColumnName(1, dataColumns[1]);
    table.setColumnName(2, dataColumns[2]);
    table.setColumnName(3, dataColumns[3]);
    table.setColumnName(4, dataColumns[4]);
     
    //add a slicer to the sheet and return the slicer instance.
    var slicer = activeSheet.slicers.add("slicer1",table.name(),"Name");
     //change the slicer properties.
    slicer.width(200);
    slicer.height(200);
    slicer.position(new GC.Spread.Sheets.Point(100, 200));
    slicer.style(GC.Spread.Sheets.Slicers.SlicerStyles.dark4());
    
    // Use IE to see the console log text
    activeSheet.bind(GC.Spread.Sheets.Events.SlicerChanged, function (e, info) {    
    console.log("name: " + info.propertyName);  
    });
    See Also

    Reference

    Events type