Skip to content

Events And Methods

Move a card to inspect the committed payload.
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.

EventPurpose
grideditUnified committed card changes from EventManager; inspect kanban-card-change and typed domainChanges.
beforekanbancardmoveCancelable proposal with cards, previous locations, target, reason, and proposed records.
kanbancardmoveCommitted moved cards, every changed canonical record, locations, and destination-bucket rebalance IDs.
kanbanselectionchangeSelected card IDs/records and replace, toggle, range, clear, or API reason.
kanbancolumnorderchangeRuntime workflow column order after native header drag or API movement.
kanbandropstatechangeCurrent valid, invalid, or order-preserving no-op target state and localized reason.
kanbandiagnosticsCurrent source/config diagnostics.
kanbancardcreaterequestHost-owned create workflow request.
kanbancardopenrequestHost-owned card detail request; the packaged editor does not consume it.
kanbancardeditrequestHost-owned card editor request.
kanbancarddeleterequestHost-owned delete workflow request.
beforekanbancardcreate / kanbancardcreateCancelable create proposal and committed canonical card.
beforekanbancardupdate / kanbancardupdateCancelable update proposal and committed card with previous record.
beforekanbancarddelete / kanbancarddeleteCancelable atomic delete proposal and committed card batch.
beforekanbancardeditorvalidateCancelable start of packaged or replacement-editor validation; listeners can add errors.
beforekanbancardeditorfieldvalidateCancelable per-field validation proposal with value and setError.
kanbancardeditorfieldvalidateCommitted valid, invalid, skipped, or cancelled result for one editor field.
kanbancardeditorvalidateCompleted editor validation result with valid, cancelled, and errors.
kanbancardeditorinvalidValidation completion that blocked submission because errors or cancellation remain.
kanbanremoteloadstartA whole-board page request started with skip, limit, reason, and current remote state.
kanbanremoteloadsuccessA page was committed to canonical cards; detail includes the returned cards and updated state.
kanbanremoteloaderrorA 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.

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.