[]
• new Slicer()
Represents a table item slicer.
▸ allowMove(value?
): any
获取或设置切片器的allowMove
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.allowMove();
console.log(oldValue);
slicer.allowMove(false);
var newValue = slicer.allowMove();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的allowMove;否则,返回切片器
▸ allowResize(value?
): any
获取或设置切片器的allowResize
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.allowResize();
console.log(oldValue);
slicer.allowResize(false);
var newValue = slicer.allowResize();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的allowResize;否则,返回切片器
▸ captionName(value?
): any
获取或设置切片器的captionName
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.captionName();
console.log(oldValue);
slicer.captionName('Slicer_Caption');
var newValue = slicer.captionName();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
string |
any
如果没有设置值,返回切片器的captionName;否则,返回切片器
▸ columnCount(value?
): any
获取或设置切片器的columnCount
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.columnCount();
console.log(oldValue);
slicer.columnCount(3);
var newValue = slicer.columnCount();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的columnCount;否则,返回切片器
▸ columnName(): string
获取切片器的列名称。 切片器的columnName 属性指定与切片器关联的源数据字段中的列的名称
string
返回切片器的列名。
▸ disableResizingAndMoving(value?
): any
获取或设置切片器的disableResizingAndMoving
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.disableResizingAndMoving();
console.log(oldValue);
slicer.disableResizingAndMoving(true);
var newValue = slicer.disableResizingAndMoving();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的disableResizingAndMoving;否则,返回切片器
▸ dynamicMove(value?
): any
获取或设置切片器的dynamicMove
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.dynamicMove();
console.log(oldValue);
slicer.dynamicMove(false);
var newValue = slicer.dynamicMove();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的dynamicMove;否则,返回切片器
▸ dynamicSize(value?
): any
获取或设置切片器的dynamicSize
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.dynamicSize();
console.log(oldValue);
slicer.dynamicSize(false);
var newValue = slicer.dynamicSize();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的dynamicSize;否则,返回切片器
▸ endColumn(value?
): any
获取或设置切片器的endColumn
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.endColumn();
console.log(oldValue);
slicer.endColumn(20);
var newValue = slicer.endColumn();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的endColumn;否则,返回切片器
▸ endColumnOffset(value?
): any
获取或设置切片器的endColumnOffset
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.endColumnOffset();
console.log(oldValue);
slicer.endColumnOffset(5);
var newValue = slicer.endColumnOffset();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的endColumnOffset;否则,返回切片器
▸ endRow(value?
): any
获取或设置切片器的endRow
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.endRow();
console.log(oldValue);
slicer.endRow(20);
var newValue = slicer.endRow();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的endRow;否则,返回切片器
▸ endRowOffset(value?
): any
获取或设置切片器的endRowOffset
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.endRowOffset();
console.log(oldValue);
slicer.endRowOffset(5);
var newValue = slicer.endRowOffset();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的endRowOffset;否则,返回切片器
▸ height(value?
): any
获取或设置切片器的高度
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.height();
console.log(oldValue);
slicer.height(200);
var newValue = slicer.height();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的高度;否则,返回切片器
▸ isLocked(value?
): any
获取或设置切片器的isLocked
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.isLocked();
console.log(oldValue);
slicer.isLocked(false);
var newValue = slicer.isLocked();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的isLocked;否则,返回切片器
▸ isSelected(value?
): any
获取或设置切片器的isSelected
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.isSelected();
console.log(oldValue);
slicer.isSelected(true);
var newValue = slicer.isSelected();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的isSelected;否则,返回切片器
▸ isVisible(value?
): any
获取或设置切片器的isVisible
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.isVisible();
console.log(oldValue);
slicer.isVisible(false);
var newValue = slicer.isVisible();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的isVisible;否则,返回切片器
▸ itemHeight(value?
): any
获取或设置切片器的itemHeight
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.itemHeight();
console.log(oldValue);
slicer.itemHeight(34);
var newValue = slicer.itemHeight();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的itemHeight;否则,返回切片器
▸ multiSelect(value?
): any
获取或设置切片器的multiSelect
代码示例
var spread = GC.Spread.Sheets.findControl('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.multiSelect();
console.log(oldValue);
slicer.multiSelect(true);
var newValue = slicer.multiSelect();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的multiSelect;否则,返回切片器
▸ name(value?
): any
获取或设置切片器的name
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.name();
console.log(oldValue);
slicer.name('SlicerA');
var newValue = slicer.name();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
string |
any
如果没有设置值,返回切片器的名称;否则,返回切片器
▸ nameInFormula(): string
切片器的nameInFormula
string
返回nameInFormula
▸ position(value?
): any
获取或设置切片器的position
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.position();
console.log(oldValue);
slicer.position(new GC.Spread.Sheets.Point(100, 200));
var newValue = slicer.position();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
Point |
any
如果没有设置值,返回切片器的position;否则,返回切片器
▸ refresh(): void
刷新切片器
void
▸ sheet(): Worksheet
获取表单
返回表单
▸ showHeader(value?
): any
获取或设置切片器的showHeader
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.showHeader();
console.log(oldValue);
slicer.showHeader(false);
var newValue = slicer.showHeader();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的showHeader;否则,返回切片器
▸ showNoDataItems(value?
): any
获取或设置切片器的showNoDataItems
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.showNoDataItems();
console.log(oldValue);
slicer.showNoDataItems(false);
var newValue = slicer.showNoDataItems();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的showNoDataItems;否则,返回切片器
▸ showNoDataItemsInLast(value?
): any
获取或设置切片器的showNoDataItemsInLast
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.showNoDataItemsInLast();
console.log(oldValue);
slicer.showNoDataItemsInLast(false);
var newValue = slicer.showNoDataItemsInLast();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的showNoDataItemsInLast;否则,返回切片器
▸ sortState(value?
): any
获取或设置切片器的sortState
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.sortState();
console.log(oldValue);
slicer.sortState(GC.Spread.Sheets.SortState.descending);
var newValue = slicer.sortState();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
SortState |
any
如果没有设置值,返回切片器的sortState;否则,返回切片器
▸ sourceName(): string
获取sourceName
string
返回sourceName
▸ startColumn(value?
): any
获取或设置切片器的startColumn
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.startColumn();
console.log(oldValue);
slicer.startColumn(10);
var newValue = slicer.startColumn();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的startColumn;否则,返回切片器
▸ startColumnOffset(value?
): any
获取或设置切片器的startColumnOffset
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.startColumnOffset();
console.log(oldValue);
slicer.startColumnOffset(15);
var newValue = slicer.startColumnOffset();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的startColumnOffset;否则,返回切片器
▸ startRow(value?
): any
获取或设置切片器的startRow
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.startRow();
console.log(oldValue);
slicer.startRow(10);
var newValue = slicer.startRow();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的startRow;否则,返回切片器
▸ startRowOffset(value?
): any
获取或设置切片器的startRowOffset
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.startRowOffset();
console.log(oldValue);
slicer.startRowOffset(15);
var newValue = slicer.startRowOffset();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的startRowOffset;否则,返回切片器
▸ style(value?
): any
获取或设置切片器的style
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var style = new GC.Spread.Sheets.Slicers.SlicerStyle();
style.wholeSlicerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo('red', 'blue', '16pt Calibri'));
style.headerStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, 'green'));
style.selectedItemWithDataStyle(new GC.Spread.Sheets.Slicers.SlicerStyleInfo(undefined, undefined, undefined, new GC.Spread.Sheets.LineBorder('pink', GC.Spread.Sheets.LineStyle.double)));
var oldValue = slicer.style();
console.log(oldValue);
slicer.style(style);
var newValue = slicer.style();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
SlicerStyle |
any
如果没有设置值,返回切片器的style;否则,返回切片器
▸ toImageSrc(): string
获取Base64字符串类型的切片器Image src。
代码示例
let slicerImageSrc = sheet.slicers.all()[0].toImageSrc();
string
返回切片器图像 Base64 src 字符串。
▸ visuallyNoDataItems(value?
): any
获取或设置切片器的visuallyNoDataItems
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.visuallyNoDataItems();
console.log(oldValue);
slicer.visuallyNoDataItems(false);
var newValue = slicer.visuallyNoDataItems();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
boolean |
any
如果没有设置值,返回切片器的visuallyNoDataItems;否则,返回切片器
▸ width(value?
): any
获取或设置切片器的width
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.width();
console.log(oldValue);
slicer.width(200);
var newValue = slicer.width();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的width;否则,返回切片器
▸ x(value?
): any
获取或设置切片器的x
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.x();
console.log(oldValue);
slicer.x(100);
var newValue = slicer.x();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的x;否则,返回切片器
▸ y(value?
): any
获取或设置切片器的y
代码示例
var spread = new GC.Spread.Sheets.Workbook('ss');
var activeSheet = spread.getActiveSheet();
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 slicer = activeSheet.slicers.add("slicer", "table1", "Name");
var oldValue = slicer.y();
console.log(oldValue);
slicer.y(100);
var newValue = slicer.y();
console.log(newValue);
属性名 | 类型 |
---|---|
value? |
number |
any
如果没有设置值,返回切片器的y;否则,返回切片器