Skip to content

GravionLabs/elysion / .agents/skills/ng-ag-grid-developer

ng-ag-grid-developer

Verified

Build or modify Angular components with AG Grid Enterprise. Use when a task mentions ag-grid.

references/cell-rendering-editing.md

View on GitHub
# AG Grid — Cell Rendering & Editing (Angular)

## Renderers

- Simple, stateless: `cellRenderer: (p: ICellRendererParams) => '<span class="badge">…</span>'` (returns HTML string)
- Stateful/interactive: implement `ICellRendererAngularComp` in a standalone component

```typescript
export class StatusCellRenderer implements ICellRendererAngularComp {
  agInit(params: ICellRendererParams): void {
    /* read params.value, params.data */
  }
  refresh(params: ICellRendererParams): boolean {
    /* update state */ return true;
  } // false → grid recreates the component
}
// ColDef: { field: 'status', cellRenderer: StatusCellRenderer, cellRendererParams: { currency: 'EUR' } }
```
Custom params arrive on `params` in `agInit` (type them by extending `ICellRendererParams`).

Per-row choice: `cellRendererSelector: p => p.node.group ? undefined : { component: X, params: {...} }` — return `undefined` for default rendering; skip group nodes.

Provided renderers: `agGroupCellRenderer` (expand/collapse for groups and master/detail), `agAnimateShowChangeCellRenderer`, `agAnimateSlideCellRenderer`, `agCheckboxCellRenderer`.

## Editing

`editable: true` or callback `editable: (p: EditableCallbackParams) => p.data.status === 'draft'`.

| Editor                      | Value                                                              | Notes                                                                        |
| --------------------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
| Text (default) / Large text | `agTextCellEditor` / `agLargeTextCellEditor`                       |                                                                              |
| Select / Rich select        | `agSelectCellEditor` / `agRichSelectCellEditor`                    | Rich select: Enterprise, `cellEditorParams: { values, searchType: 'fuzzy' }` |
| Number / Date / Checkbox    | `agNumberCellEditor` / `agDateCellEditor` / `agCheckboxCellEditor` |                                                                              |

Custom editor: implement `ICellEditorAngularComp` with `agInit(params: ICellEditorParams)`, `getValue()` (final value) and optional `isPopup()`; use as `cellEditor: MyEditor`. Per-row: `cellEditorSelector: p => ({ component: 'agRichSelectCellEditor', params: { values: p.data.options } })`.

Events: `(cellValueChanged)` — persist `event.data`; `(cellEditingStarted)`, `(cellEditingStopped)` — check `event.valueChanged`.

Programmatic: `api.startEditingCell({ rowIndex, colKey })`, `api.stopEditing(false)` commit, `api.stopEditing(true)` cancel.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall