Events And Methods
Get the plugin
Section titled “Get the plugin”import { KanbanPlugin } from '@revolist/kanban';
const plugins = await grid.getPlugins();const kanban = plugins.find((plugin) => plugin instanceof KanbanPlugin);Public methods are getCards, getConfig, getProjection, createCard, updateCard, deleteCards, moveCards, getSelectedCardIds, setSelectedCardIds, revealCard, getColumnOrder, setColumnOrder, getCollapsedColumnProps, setColumnCollapsed, getSwimlaneColumnCollapsed, setSwimlaneColumnCollapsed, refresh, getDiagnostics, getRemoteState, loadMoreCards, refreshRemote, requestCreateCard, requestOpenCard, requestEditCard, and requestDeleteCards. Obtain the plugin from RevoGrid rather than installing reverse callbacks on the grid element.
await kanban.revealCard(cardId) scrolls a currently rendered card’s native
grid row and workflow column into view. It resolves to false when the card is
missing, filtered, or hidden by collapsed presentation state.
Event reference
Section titled “Event reference”| Event | Purpose |
|---|---|
gridedit | Unified committed card changes from EventManager; inspect kanban-card-change and typed domainChanges. |
beforekanbancardmove | Cancelable proposal with cards, previous locations, target, reason, and proposed records. |
kanbancardmove | Committed moved cards, every changed canonical record, locations, and destination-bucket rebalance IDs. |
kanbanselectionchange | Selected card IDs/records and replace, toggle, range, clear, or API reason. |
kanbancolumnorderchange | Runtime workflow column order after native header drag or API movement. |
kanbandropstatechange | Current valid, invalid, or order-preserving no-op target state and localized reason. |
kanbandiagnostics | Current source/config diagnostics. |
kanbancardcreaterequest | Host-owned create workflow request. |
kanbancardopenrequest | Host-owned card detail request; the packaged editor does not consume it. |
kanbancardeditrequest | Host-owned card editor request. |
kanbancarddeleterequest | Host-owned delete workflow request. |
beforekanbancardcreate / kanbancardcreate | Cancelable create proposal and committed canonical card. |
beforekanbancardupdate / kanbancardupdate | Cancelable update proposal and committed card with previous record. |
beforekanbancarddelete / kanbancarddelete | Cancelable atomic delete proposal and committed card batch. |
beforekanbancardeditorvalidate | Cancelable start of packaged or replacement-editor validation; listeners can add errors. |
beforekanbancardeditorfieldvalidate | Cancelable per-field validation proposal with value and setError. |
kanbancardeditorfieldvalidate | Committed valid, invalid, skipped, or cancelled result for one editor field. |
kanbancardeditorvalidate | Completed editor validation result with valid, cancelled, and errors. |
kanbancardeditorinvalid | Validation completion that blocked submission because errors or cancellation remain. |
kanbanremoteloadstart | A whole-board page request started with skip, limit, reason, and current remote state. |
kanbanremoteloadsuccess | A page was committed to canonical cards; detail includes the returned cards and updated state. |
kanbanremoteloaderror | A page failed without removing loaded cards; detail includes the error and retryable state. |
Event constants such as BEFORE_KANBAN_CARD_MOVE_EVENT and KANBAN_CARD_MOVE_EVENT are exported for refactor-safe listeners.
Every successful create, update, delete, or move also reaches the shared
gridedit stream with kanban-card-change in eventTypes. Its ordered
domainChanges contains one kanban-card entry per changed canonical card,
including cards re-ranked during a move. Each entry provides the action, card
ID, previous card, and committed card. Create uses a null previous card and
delete uses a null committed card.
data, previousData, and models contain only ordinary row/field patches for
cards that retain a stable canonical source index. Creates, deletes, and
position changes without a safe grid coordinate remain in domainChanges;
compact undo/redo state lives separately in history.
The Kanban beforekanban* events remain the cancellation boundary. A Kanban
gridedit has sourceMutation: 'producer', is observational, and calling
preventDefault() does not roll back the already committed mutation.
Passing skipHistory: true to a mutation still publishes this event with
recordHistory: false, but History deliberately creates no undo entry.
Remote loading exports KANBAN_REMOTE_LOAD_START_EVENT,
KANBAN_REMOTE_LOAD_SUCCESS_EVENT, and KANBAN_REMOTE_LOAD_ERROR_EVENT.
Call getRemoteState() for loading, nextOffset, hasMore, total, and
error; loadMoreCards() requests the next page and refreshRemote() clears
cards and history, or reinitializes configured placeholders, before loading
page zero. Both loading methods return a
promise and deduplicate concurrent requests.
Editor validation constants are exported with
KanbanCardEditorDialogPlugin. beforekanbancardeditorvalidate and
beforekanbancardeditorfieldvalidate are cancelable; all other validation
events report committed results. Cancelling validation always blocks submit.
Cancel and persist a move
Section titled “Cancel and persist a move”grid.addEventListener(BEFORE_KANBAN_CARD_MOVE_EVENT, (event) => { if (!permissions.canMove(event.detail.cardIds, event.detail.target)) { event.preventDefault(); }});
grid.addEventListener(KANBAN_CARD_MOVE_EVENT, async (event) => { await api.saveCards(event.detail.changedCards);});Before-move listeners must make their cancel decision synchronously. Resolve remote authorization into local policy state before dragging begins.
CRUD request events remain the stable integration point. With KanbanCardEditorDialogPlugin installed they open the packaged workflow; without it, when it is disabled, or when a listener cancels the request, the application remains responsible. Committed mutation events are suitable for synchronizing remote state.