Page tree

Versions Compared

Key

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

You can allow the user to resize columns and rows or specific columns or rows. Multiple selected columns or rows can also be resized.
Move the pointer over the border between the column or row header. The pointer will change to a double arrow. Click and drag to the right or left to resize the column and row and release the mouse to change the column width or row height. A preview line is displayed when dragging.
Image Removed
You can still resize a row or column with zero height or width if the options.resizeZeroIndicator property is set to Enhanced.
Image Removed
Using Code
This example specifies whether the column and row are resizable.你可以允许用户重设某行或者某列的行宽或者列高。

该操作支持多选行或者多选列的重设大小。

将鼠标指针移动到两个行标题单元格或者列标题单元格之间,鼠标指针将会变为“重设大小”的形状。按下并拖动即可设置行高或者列宽。松开鼠标键结束调整。

在拖动的时候将会显示一条预览线。


Image Added

当  options.resizeZeroIndicator 属性设置为 Enhanced 时,你可以重设宽度为 0 的列和高度为 0 的行的大小。


Image Added
示例代码
以下代码设置了行或者列是否可以被重设大小。

JavaScript

Copy Code

activeSheet.setRowResizable(3,false,GC.Spread.Sheets.SheetArea.viewport); activeSheet.setColumnResizable(3,false,GC.Spread.Sheets.SheetArea.viewport);activeSheet.getRange(1, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).resizable(false);activeSheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).resizable(false);

 

Using Code
This example specifies whether the column and row are resizable.示例代码
以下代码仍然设置了行或者列是否可以被重设大小。

JavaScript

Copy Code

activeSheet.setRowCount(10);activeSheet.setColumnCount(7);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.setColumnResizable(0,true, GC.Spread.Sheets.SheetArea.colHeader);activeSheet.setRowResizable(0,true, GC.Spread.Sheets.SheetArea.rowHeader);alert(activeSheet.getColumnResizable(0));alert(activeSheet.getRowResizable(0, GC.Spread.Sheets.SheetArea.rowHeader));

 

See Also另见
setColumnResizable Method
setRowResizable Method