ClearRowSelection | func (dg *DataGrid) ClearRowSelection() | ClearRowSelection clears all row selections. |
GetCellValue | func (dg *DataGrid) GetCellValue(pos CellPosition) string | GetCellValue returns the display value for a cell, reading through the changeset overlay.
If the cell is dirty, returns the modified value; otherwise returns the source value. |
GetChangeset | func (dg *DataGrid) GetChangeset() *Changeset | GetChangeset returns the changeset for external inspection. |
GetCursor | func (dg *DataGrid) GetCursor() CellPosition | GetCursor returns the current cursor position. |
GetCursorRow | func (dg *DataGrid) GetCursorRow() map[string]string | GetCursorRow returns the cursor row as a map of column name to display value (with changeset overlay). |
GetCursorRowIndex | func (dg *DataGrid) GetCursorRowIndex() int | GetCursorRowIndex returns the current cursor row index. |
GetCursorRowRaw | func (dg *DataGrid) GetCursorRowRaw() map[string]any | GetCursorRowRaw returns the cursor row as a map of column name to RawValue. |
GetMode | func (dg *DataGrid) GetMode() GridMode | GetMode returns the current grid mode. |
GetSelectedRowIndices | func (dg *DataGrid) GetSelectedRowIndices() []int | GetSelectedRowIndices returns all selected row indices sorted ascending. |
GetSelectedRows | func (dg *DataGrid) GetSelectedRows() []map[string]string | GetSelectedRows returns all selected rows as column name to value maps. |
GetSelectedRowsRaw | func (dg *DataGrid) GetSelectedRowsRaw() []map[string]any | GetSelectedRowsRaw returns all selected rows as column name to RawValue maps. |
Hints | func (dg *DataGrid) Hints() []KeyHint | Hints returns mode-appropriate key hints. |
IsRowSelected | func (dg *DataGrid) IsRowSelected(row int) bool | IsRowSelected returns whether the given row is selected. |
SelectAllRows | func (dg *DataGrid) SelectAllRows() | SelectAllRows selects all rows. |
SetOnBack | func (dg *DataGrid) SetOnBack(fn func()) *DataGrid | SetOnBack sets the callback for the back/escape action. |
SetOnCellEdit | func (dg *DataGrid) SetOnCellEdit(fn func(pos CellPosition, oldValue, newValue string)) *DataGrid | SetOnCellEdit sets the callback for when a cell edit is committed. |
SetOnCellSelect | func (dg *DataGrid) SetOnCellSelect(fn func(pos CellPosition, cell GridCell)) *DataGrid | SetOnCellSelect sets the callback for when Enter is pressed on a cell. |
SetOnChangesetUpdate | func (dg *DataGrid) SetOnChangesetUpdate(fn func(changeset *Changeset)) *DataGrid | SetOnChangesetUpdate sets the callback for changeset modifications. |
SetOnCopy | func (dg *DataGrid) SetOnCopy(fn func(value string)) *DataGrid | SetOnCopy sets the callback for copying a cell value (y key). |
SetOnCursorMove | func (dg *DataGrid) SetOnCursorMove(fn func(pos CellPosition)) *DataGrid | SetOnCursorMove sets the callback for cursor position changes. |
SetOnModalEdit | func (dg *DataGrid) SetOnModalEdit(fn func(pos CellPosition, currentValue string, commit func(string))) *DataGrid | SetOnModalEdit sets the callback for triggering modal (multi-line) editing.
The consumer creates a Modal with TextArea and calls commit(newValue) when done. |
SetOnModeChange | func (dg *DataGrid) SetOnModeChange(fn func(mode GridMode)) *DataGrid | SetOnModeChange sets the callback for mode transitions. |
SetOnRowSelect | func (dg *DataGrid) SetOnRowSelect(fn func(row int, data map[string]string)) *DataGrid | SetOnRowSelect sets the callback that fires when the cursor moves to a new row.
Useful for updating preview panels with the current row data. |
SetOnSearch | func (dg *DataGrid) SetOnSearch(fn func()) *DataGrid | SetOnSearch sets the callback for the search trigger (/ key). |
SetOnSelectionChange | func (dg *DataGrid) SetOnSelectionChange(fn func(rows []int)) *DataGrid | SetOnSelectionChange sets the callback that fires when multi-select changes. |
SetOnSubmit | func (dg *DataGrid) SetOnSubmit(fn func(changeset *Changeset)) *DataGrid | SetOnSubmit sets the callback for submitting pending changes.
The callback receives the current changeset. After a successful apply,
the consumer should call changeset.Clear() to reset dirty state. |
SetOverscan | func (dg *DataGrid) SetOverscan(count int) *DataGrid | SetOverscan sets how many rows to pre-fetch outside the visible area. |
SetSeparator | func (dg *DataGrid) SetSeparator(sep rune) *DataGrid | SetSeparator sets the column separator character. |
SetShowHeader | func (dg *DataGrid) SetShowHeader(show bool) *DataGrid | SetShowHeader enables or disables the column header row. |
SetShowRowNumbers | func (dg *DataGrid) SetShowRowNumbers(show bool) *DataGrid | SetShowRowNumbers enables or disables the row number gutter. |
SetSource | func (dg *DataGrid) SetSource(source DataGridSource) *DataGrid | SetSource sets the data source for the grid. |
Submit | func (dg *DataGrid) Submit() | Submit triggers the submit callback if there are pending changes.
Safe to call from external keybindings or buttons. |
ToggleRowSelection | func (dg *DataGrid) ToggleRowSelection() | ToggleRowSelection toggles selection of the current cursor row.
Safe to call from outside; also callable internally (caller must hold mu). |