From: Andrea Zagli Date: Wed, 22 Jun 2022 13:47:44 +0000 (+0200) Subject: Added method GetColumn. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=6dbb92f846c8b47f111790d27a94cd9090dad171;p=zakgrid_go Added method GetColumn. --- 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 == "" {