Highlighting and Jumping

View as Markdown

Summary

  • The Grid API provides highlight and jump helper functions for temporary, code-driven focus and styling:
    • Highlights use an Adaptable Style object (optional timeout)
    • Jump moves scroll/focus to a row, column or cell (often used together with highlights)

The Grid API includes helpers for two related, grid-level actions:

  • Highlighting cells, rows and columns
  • Jumping to rows, columns and cells

Note

  • This page shows highlighting & jumping via Grid API directly; AdapTable modules with similar behaviour include:
    • Alert Behaviours — when an alert fires you can configure Highlight Cell (or Row) and Jump to Cell (or Row)
    • Flashing Cells — flashes when a Change or Observable rule is true
    • Format Column — persistent column styling or conditional formatting

Highlighting

There are a number of Grid API functions which facilitate cell, row and column highlighting:

  • highlightCell
  • unHighlightCell
  • unHighlightAllCells
  • highlightColumn
  • unHighlightColumn
  • unHighlightAllColumns
  • highlightRow
  • highlightRows
  • unHighlightRow
  • unHighlightRows
  • unHighlightAllRows

Caution

Grid API highlighting is impermanent and caller-controlled (you clear it or rely on a timeout*

Highlighting Cells and Rows
Fork
  • This demo provides examples of highlighting and unhighlighting using the Grid API (using Custom Toolbar Buttons):
    • First button calls highlightCell to highlight the Name cell for ember.js with a white fore colour and purple back colour (timeout 5 seconds)
    • Second button calls highlightRow to highlight the whole row for Solid with a gray fore colour and brown back colour
    • Third button calls unHighlightRow for the Solid row, which clears the highlight
    • Fourth button calls highlightColumn for the Github Stars column (timeout 3 seconds)
Loading demo…

Style

Each highlight function receives a commonly used Adaptable Style object which contains numerous properties, allowing for full control over how the highlight looks.

Timeout

The highlight functions can be provided with a timeout specifying how long the cell or row will remain highlighted.

Deep Dive

Highlight Info Objects and Styles


Jumping

The Grid API section of AdapTable API contains 3 functions that enable moving the focus in the Grid to specific cells, rows or columns:

  • jumpToRow
  • jumpToColumn
  • jumpToCell
Jumping to Cells and Rows
Fork
  • This demo provides examples of "jumping" using the Grid API
  • We provide 3 Custom Toolbar Buttons which each call a jump-related function:
    • First button calls jumpToCell function to jump to Created At in the Quasar row (the last row in the grid)
    • Second button calls jumpToRow function to jump to Angular row (2nd from top)
    • Third button calls jumpToColumn function to jump to the Issue Change column (at the far end of the grid)
  • Additionally we provide a Custom Context Menu Item that displays all Columns in the Grid, and AdapTable will jump to the Column selected
Loading demo…