From 6dbb92f846c8b47f111790d27a94cd9090dad171 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Wed, 22 Jun 2022 15:47:44 +0200 Subject: [PATCH] Added method GetColumn. --- grid/grid.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grid/grid.go b/grid/grid.go index 23cbff5..a32b99f 100644 --- a/grid/grid.go +++ b/grid/grid.go @@ -33,6 +33,15 @@ func (g *Grid) AddColumn (c Column) { g.cols = append(g.cols, c) } +func (g *Grid) GetColumn (col_name string) (*Column) { + for i, c := range g.cols { + if c.Name == col_name { + return &g.cols[i] + } + } + return nil +} + func (g *Grid) GetHeader () string { htmpl := g.HeaderTmpl if htmpl == "" { -- 2.49.0