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
| Value | Description |
|---|---|
columns | Status columns with their entities |
onDragEnd | Drag-and-drop completion handler |
loading | Loading state |
error | Error 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
| Prop | Type | Description |
|---|---|---|
entityConfig | EntityConfig | Entity API configuration |
statusField | string | Field that determines column placement |
statusOptions | StatusOption[] | 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.
Related
Last updated on