SpreadJS Documentation
ItemSlicer Method
GC.Spread.Sheets Namespace > Slicers type : ItemSlicer Method
The name of the item slicer.
An instance of the GeneralSlicerData or TableSlicerData.
The column name that relates to the item slicer.
Represents an item slicer.
Syntax
var value; // Type: any
value = GC.Spread.Sheets.Slicers.ItemSlicer(name, slicerData, columnName);
function ItemSlicer( 
   name : string,
   slicerData : GeneralSlicerData,
   columnName : string
) : any;

Parameters

name
The name of the item slicer.
slicerData
An instance of the GeneralSlicerData or TableSlicerData.
columnName
The column name that relates to the item slicer.
Example
//This example creates an item slicer.
//create table
var dataSource = [
    { Name: "Bob", City: "NewYork", Birthday: "1968/6/8" },
    { Name: "Betty", City: "NewYork", Birthday: "1972/7/3" },
    { Name: "Alice", City: "Washington", Birthday: "2012/2/15" },
];
var table = activeSheet.tables.addFromDataSource("table1", 1, 1, dataSource);
var slicerData = new GC.Spread.Sheets.Slicers.TableSlicerData(table)
//Set slicer data to item slicer.
var slicer = new GC.Spread.Sheets.Slicers.ItemSlicer("slicer", slicerData, "Name");
//Add the item slicer to the dom tree.
//The "slicerHost" is the div you want to add the slicer's dom to.
$("#slicerHost").append(slicer.getDOMElement());
See Also

Reference

Slicers type