summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
authorRi Xu <xuri.me@gmail.com>2017-06-08 11:11:11 +0800
committerRi Xu <xuri.me@gmail.com>2017-06-08 11:11:11 +0800
commitc89d84235238f1e2a37b03551ca6ef652c2f3769 (patch)
tree6ed520a68e78cca3a4bb9b932a5cdbd4c4cc5499 /rows.go
parentc5dc63295186ad35ece6a2c9c940e84665f9f98f (diff)
Init auto filter support, relate issue #59.
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/rows.go b/rows.go
index 52a360c..3f90dcb 100644
--- a/rows.go
+++ b/rows.go
@@ -148,3 +148,27 @@ func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) {
return f.formattedValue(xlsx.S, xlsx.V), nil
}
}
+
+// HideRow provides a function to set hidden of a single row by given worksheet index and row index. For example, hide row 3 in Sheet1:
+//
+// xlsx.HideRow("Sheet1", 2)
+//
+func (f *File) HideRow(sheet string, rowIndex int) {
+ xlsx := f.workSheetReader(sheet)
+ rows := rowIndex + 1
+ cells := 0
+ completeRow(xlsx, rows, cells)
+ xlsx.SheetData.Row[rowIndex].Hidden = true
+}
+
+// UnhideRow provides a function to set unhidden of a single row by given worksheet index and row index. For example, unhide row 3 in Sheet1:
+//
+// xlsx.UnhideRow("Sheet1", 2)
+//
+func (f *File) UnhideRow(sheet string, rowIndex int) {
+ xlsx := f.workSheetReader(sheet)
+ rows := rowIndex + 1
+ cells := 0
+ completeRow(xlsx, rows, cells)
+ xlsx.SheetData.Row[rowIndex].Hidden = false
+}