Page tree

Versions Compared

Key

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

You can use a tag to store data in a cell, column, row, or sheet. Tags can store any type of data and are not visible to the user.

You can remove tags with the clear method. Tags can be cut, copied, pasted, or moved.

If the tag type is a string, then the tag can be searched. Tags are supported with undo and redo. Basic tags are supported when importing or exporting to JSON files. Custom tags are not supported when importing or exporting to JSON files.

Adding tags can also cause the CellChangedColumnChanged, or RowChanged event to occur.

Using Code

The following code adds a tag to a cell with the setTag method.你可以使用 tag 在单元格,行,列或者工作表中添加数据。

Tag 可以时任何数据类型,并且对用户是不可见的。

你可以使用 clear 方法来清除 tag。Tag 可以被删除,剪切,粘贴或者移动。

如果 tag 的类型为字符串,那它也会参与搜索。Tag 也支持撤销和重做。

Tag 不支持 JSON 数据的导入和导出。

添加 tag 也会导致 CellChangedColumnChanged 或者 RowChanged 事件触发。

示例代码

以下代码使用了 setTag 方法来给单元格添加 tag。

JavaScript

Copy Code

activeSheet.setTag(1,1,"test");
alert(activeSheet.getTag(1,1,GC.Spread.Sheets.SheetArea.viewport));




See Also另见
getTag Method
tag Method