MCPcopy
hub / github.com/g3n/engine / SetColExpand

Method SetColExpand

gui/table.go:484–497  ·  view source on GitHub ↗

SetColExpand sets the column expand factor. When the table width is increased the columns widths are increased proportionally to their expand factor. A column with expand factor = 0 is not increased.

(colid string, expand float32)

Source from the content-addressed store, hash-verified

482// increased proportionally to their expand factor.
483// A column with expand factor = 0 is not increased.
484func (t *Table) SetColExpand(colid string, expand float32) {
485
486 // Checks column id
487 c := t.header.cmap[colid]
488 if c == nil {
489 panic(tableErrInvCol)
490 }
491 if expand < 0 {
492 c.expand = 0
493 } else {
494 c.expand = expand
495 }
496 t.recalc()
497}
498
499// AddRow adds a new row at the end of the table with the specified values
500func (t *Table) AddRow(values map[string]interface{}) {

Callers

nothing calls this directly

Calls 1

recalcMethod · 0.95

Tested by

no test coverage detected