SetIndexView sets the source IndexView of a table (using a copy so original is not modified) and then configures the display
(ix *table.IndexView)
| 157 | // SetIndexView sets the source IndexView of a table (using a copy so original is not modified) |
| 158 | // and then configures the display |
| 159 | func (tb *Table) SetIndexView(ix *table.IndexView) *Table { |
| 160 | if ix == nil { |
| 161 | return tb |
| 162 | } |
| 163 | |
| 164 | tb.Table = ix.Clone() // always copy |
| 165 | |
| 166 | tb.This.(core.Lister).UpdateSliceSize() |
| 167 | tb.StartIndex = 0 |
| 168 | tb.VisibleRows = tb.MinRows |
| 169 | if !tb.IsReadOnly() { |
| 170 | tb.SelectedIndex = -1 |
| 171 | } |
| 172 | tb.ResetSelectedIndexes() |
| 173 | tb.SelectMode = false |
| 174 | tb.MakeIter = 0 |
| 175 | tb.Update() |
| 176 | return tb |
| 177 | } |
| 178 | |
| 179 | func (tb *Table) UpdateSliceSize() int { |
| 180 | tb.Table.DeleteInvalid() // table could have changed |
nothing calls this directly
no test coverage detected