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

Method SetCell

gui/table.go:400–410  ·  view source on GitHub ↗

SetCell sets the value of the cell specified by its row and column id The function panics if the passed row or column id is invalid

(row int, colid string, value interface{})

Source from the content-addressed store, hash-verified

398// SetCell sets the value of the cell specified by its row and column id
399// The function panics if the passed row or column id is invalid
400func (t *Table) SetCell(row int, colid string, value interface{}) {
401
402 if row < 0 || row >= len(t.rows) {
403 panic(tableErrInvRow)
404 }
405 if t.header.cmap[colid] == nil {
406 panic(tableErrInvCol)
407 }
408 t.setCell(row, colid, value)
409 t.recalc()
410}
411
412// SetColFormat sets the formatting string (Printf) for the specified column
413// Update must be called to update the table.

Callers 1

UpdateMethod · 0.80

Calls 2

setCellMethod · 0.95
recalcMethod · 0.95

Tested by

no test coverage detected