Ver código
<co-data-table></co-data-table>
Props
| Prop | Atributo | Tipo | Default | Descripción |
|---|
columns | columns | CoDataTableColumn[] | string | '[]' | Column definitions (JSON string or array) |
emptyIcon | empty-icon | string | 'magnifying-glass' | Empty state icon (Phosphor icon name). |
emptyMessage | empty-message | string | 'No records found' | Empty state secondary message (description). |
emptyTitle | empty-title | string | '' | Empty state title (bold heading). Optional — falls back to just the message. |
loading | loading | boolean | false | Show loading skeleton |
resizable | resizable | boolean | true | Enable column resizing |
rowKey | row-key | string | '_id' | Field used as unique row identifier |
rows | rows | any[] | string | '[]' | Row data (JSON string or array) |
selectable | selectable | boolean | false | Enable row selection with checkboxes |
selectedKeys | selected-keys | string | string[] | '[]' | Keys of currently selected rows (JSON string or array) |
skeletonRows | skeleton-rows | number | 10 | Number of skeleton rows to display |
sortField | sort-field | string | '' | Current sort field |
sortOrder | sort-order | "" | "asc" | "desc" | '' | Current sort direction |
Eventos
| Evento | Detail | Bubbles | Cancelable | Descripción |
|---|
coColumnPin | { field: string; } | ✓ | ✓ | Emitted when a column pin (sticky) is requested |
coColumnResize | { field: string; width: number; } | ✓ | ✓ | Emitted when a column is resized |
coRowClick | { row: any; index: number; } | ✓ | ✓ | Emitted when a row is clicked |
coRowDblClick | { row: any; index: number; } | ✓ | ✓ | Emitted when a row is double-clicked |
coRowSelect | { key: string; selected: boolean; } | ✓ | ✓ | Emitted when a row is selected/deselected |
coSelectAll | { selected: boolean; } | ✓ | ✓ | Emitted when select-all checkbox toggles |
coSort | { field: string; order: "desc" | "asc"; } | ✓ | ✓ | Emitted when a column sort is requested |
Slots
| Slot | Descripción |
|---|
(default) | Default slot for custom row content (advanced usage) |
CSS Parts
| Part | Descripción |
|---|
::part(empty) | |
CSS Custom Properties
Este componente no expone CSS custom properties.