SpreadJS Documentation > Developer's Guide > Managing Data > Adding a Tag to a Cell |
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 CellChanged, ColumnChanged, or RowChanged event to occur.
The following code adds a tag to a cell with the setTag method.
JavaScript |
Copy Code
|
---|---|
activeSheet.setTag(1,1,"test"); alert(activeSheet.getTag(1,1,GcSpread.Sheets.SheetArea.viewport)); |