1 Commits

Author SHA1 Message Date
Maas Lalani
1e920595f2 feat(table): add SetColumns method to set columns 2022-09-27 13:11:34 -04:00

View File

@@ -264,6 +264,12 @@ func (m *Model) SetRows(r []Row) {
m.UpdateViewport() 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. // SetWidth sets the width of the viewport of the table.
func (m *Model) SetWidth(w int) { func (m *Model) SetWidth(w int) {
m.viewport.Width = w m.viewport.Width = w