Skip to Content
FrontendBundlesCRUDContextsKanban Listing Context

Kanban Listing Context

KanbanListingContext manages state for the Kanban board view. It extends ListingContext with column definitions, drag-and-drop handlers, and status update API calls.


Import

import { KanbanListingContext } from "@phpcreation/frontend-crud-react-nextjs-bundle/contexts/KanbanListingContext";

What It Provides

ValueDescription
columnsStatus columns with their entities
onDragEndDrag-and-drop completion handler
loadingLoading state
errorError state

Usage

import { KanbanListingContext } from "..."; import { KanbanBoard } from "..."; <KanbanListingContext entityConfig={entityConfig} statusField="status" statusOptions={[ { value: "draft", label: "Draft" }, { value: "active", label: "Active" }, { value: "closed", label: "Closed" }, ]} > <KanbanBoard /> </KanbanListingContext>

Props

PropTypeDescription
entityConfigEntityConfigEntity API configuration
statusFieldstringField that determines column placement
statusOptionsStatusOption[]Column definitions
onStatusChange(id, newStatus) => Promise<void>Custom status update handler

By default, drag-and-drop triggers a PATCH to update the statusField of the entity. Provide onStatusChange to override this behavior.


Last updated on