Skip to content

Commit

Permalink
feat(table): add SetColumns method to set columns
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Dec 1, 2022
1 parent 9bcda81 commit e78f923
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,12 @@ func (m *Model) SetRows(r []Row) {
m.UpdateViewport()
}

// SetColumns set a new columns state.
func (m *Model) SetColumns(c []Column) {
m.cols = c
m.UpdateViewport()
}

// SetWidth sets the width of the viewport of the table.
func (m *Model) SetWidth(w int) {
m.viewport.Width = w
Expand Down Expand Up @@ -326,7 +332,6 @@ func (m *Model) MoveUp(n int) {
m.viewport.YOffset = clamp(m.viewport.YOffset+n, 1, m.viewport.Height)
}
m.UpdateViewport()

}

// MoveDown moves the selection down by any number of row.
Expand Down

0 comments on commit e78f923

Please sign in to comment.