Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

你可以使用 unGroup 来取消分组



示例代码

以下代码创建了一个列分组和一个行分组。

Code Block
languagejs
titleJavaScript

...

Copy Code

activeSheet.setRowCount(34);
activeSheet.setValue(0,0,"Western");
activeSheet.setValue(0,1,"Western");
activeSheet.setValue(0,2,"Western");
activeSheet.setValue(1,0,"A");
activeSheet.setValue(1,1,"B");
activeSheet.setValue(1,2,"C");
activeSheet.setValue(2,0,"A");
activeSheet.setValue(2,1,"B");
activeSheet.setValue(2,2,"C");
activeSheet.rowOutlines.group(0,2);
activeSheet.columnOutlines.group(0,1);
//activeSheet.rowOutlines.expand(0,false);
//activeSheet.columnOutlines.expand(0,false);
spread.invalidateLayout();
spread.repaint();

...

 

示例代码

以下代码展示了分组方向。

Code Block
languagejs
titleJavaScript

...

Copy Code

activeSheet.rowOutlines.group(3,2);
activeSheet.columnOutlines.group(4,1);
activeSheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward);
activeSheet.columnOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.forward);
spread.invalidateLayout();
spread.repaint();

...

 

示例代码

...

以下代码使用 execute 方法指定了分组时的动作。
This example specifies an action and uses the execute method.

...

JavaScript

...

Copy Code

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="437fef3a-b118-4303-a4e6-8379df51afa5"><ac:plain-text-body><![CDATA[

 方法指定了分组时的动作。

Code Block
languagejs
titleJavaScript
var spread = new GC.Spread.Sheets.Workbook($("#ss")[0]);
var activeSheet = spread.getActiveSheet();
spread.commandManager().execute({cmd: "outlineRow", sheetName: activeSheet.name(), index: 4, count: 3});

...

 

...

]]></ac:plain-text-body></ac:structured-macro>

示例代码

以下代码演示了如何查找一个分组。

Code Block
languagejs
titleJavaScript

...

Copy Code

activeSheet.rowOutlines.group(0,5);
var rgi = activeSheet.rowOutlines.find(1, 0);
rgi.state(GC.Spread.Sheets.Outlines.OutlineState.collapsed);
spread.invalidateLayout();
spread.repaint();

...

 

示例代码

以下代码设使用了 showRowOutline 和 showColumnOutline 方法
This example sets the showRowOutline and showColumnOutline methods.

Code Block
languagejs
titleJavaScript

...

Copy Code

activeSheet.showRowOutline(true);
activeSheet.rowOutlines.group(0, 2);
activeSheet.showColumnOutline(true);
activeSheet.columnOutlines.group(0, 2);
//activeSheet.rowOutlines.ungroup(0, 2);
//activeSheet.columnOutlines.ungroup(0, 2);
spread.invalidateLayout();
spread.repaint();

...

 

另见

expandGroup Method
expand Method
group Method
Workbook Method