SpreadJS Documentation
TableSlicerData Constructor
The table.
Represents table slicer data.
Syntax
var instance = new GcSpread.Sheets.TableSlicerData(table);
function TableSlicerData( 
   table : GcSpread.Sheets.ISheetTable
) : TableSlicerData;

Parameters

table
The table.
Example
This example creates a slicer for the table.
//create item slicer
var slicer = new GcSpread.Sheets.ItemSlicer("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 = sheet.addTableByDataSource("table1", 1, 1, dataSource);
var slicerData = new GcSpread.Sheets.TableSlicerData(table)
//Set slicer data to item slicer.
slicer.setData(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());

.....
<div id="slicerHost" style="height: 300px; width: 50%"></div>
See Also

Reference

TableSlicerData class

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.