Skip to content

Table rendering support - registering/using custom cell renderers #1151

@mofojed

Description

@mofojed

GridModel will need to have a way of specifying a new type of renderer on a per cell basis. Currently we just support rendering text, so that should be the default cell renderer, and then allow for registering/specifying different renderers. We can have a TextCellRenderer as the default, and BarGaugeRenderer packaged in @deephaven/grid, but not a default.

  • Add a rendererForCell(column: ModelIndex, row: ModelIndex): CellRendererType and type CellRendererType = string
  • Refactor text cell rendering to a separate class TextCellRenderer and use that from GridRenderer when rendering a cell by default (or if renderer not specified)
  • Allow registering a different types of renderers that GridRenderer.drawCellContents will automatically call if there's a renderer specified for that cell
  • Create BarGaugeRenderer, and an extension to GridModel for the details required for BarGaugeRenderer

We should be able to test this out in the style guide using a mock (similar to MockGridModel).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions