insertRow is the internal version of InsertRow which does not call recalc()
(row int, values map[string]interface{})
| 688 | |
| 689 | // insertRow is the internal version of InsertRow which does not call recalc() |
| 690 | func (t *Table) insertRow(row int, values map[string]interface{}) { |
| 691 | |
| 692 | // Creates tableRow panel |
| 693 | trow := new(tableRow) |
| 694 | trow.Initialize(trow, 0, 0) |
| 695 | trow.cells = make([]*tableCell, 0) |
| 696 | for ci := 0; ci < len(t.header.cols); ci++ { |
| 697 | // Creates tableRow cell panel |
| 698 | cell := new(tableCell) |
| 699 | cell.Initialize(cell, 0, 0) |
| 700 | cell.label.initialize("", StyleDefault().Font) |
| 701 | cell.Add(&cell.label) |
| 702 | trow.cells = append(trow.cells, cell) |
| 703 | trow.Panel.Add(cell) |
| 704 | } |
| 705 | t.Panel.Add(trow) |
| 706 | |
| 707 | // Inserts tableRow in the table rows at the specified index |
| 708 | t.rows = append(t.rows, nil) |
| 709 | copy(t.rows[row+1:], t.rows[row:]) |
| 710 | t.rows[row] = trow |
| 711 | t.updateRowStyle(row) |
| 712 | |
| 713 | // Sets the new row values from the specified map |
| 714 | if values != nil { |
| 715 | t.SetRow(row, values) |
| 716 | } |
| 717 | t.recalcRow(row) |
| 718 | } |
| 719 | |
| 720 | // ScrollDown scrolls the table the specified number of rows down if possible |
| 721 | func (t *Table) scrollDown(n int) { |
no test coverage detected