Build a UI5 Kanban Board with Drag and Drop

UI5 has no kanban control in sap.m, but you can build one from three lists. Give each list a DragInfo and a DropInfo with the same groupName, filter the lists by status, and change the status of the task on drop.
Three lists and one drop handler
<HBox>
<VBox width="33%">
<Title text="To do"/>
<List id="todo" class="sapUiSmallMargin" noDataText="Drop here"
items="{path: '/tasks', filters: {path: 'column', operator: 'EQ', value1: 'todo'}}">
<dragDropConfig>
<dnd:DragInfo groupName="cards" sourceAggregation="items"/>
<dnd:DropInfo groupName="cards" drop=".onDrop"/>
</dragDropConfig>
<StandardListItem title="{title}"/>
</List>
</VBox>
<VBox width="33%">
<Title text="In progress"/>
<List id="doing" class="sapUiSmallMargin" noDataText="Drop here"
items="{path: '/tasks', filters: {path: 'column', operator: 'EQ', value1: 'doing'}}">
<dragDropConfig>
<dnd:DragInfo groupName="cards" sourceAggregation="items"/>
<dnd:DropInfo groupName="cards" drop=".onDrop"/>
</dragDropConfig>
<StandardListItem title="{title}"/>
</List>
</VBox>
<VBox width="33%">
<Title text="Done"/>
<List id="done" class="sapUiSmallMargin" noDataText="Drop here"
items="{path: '/tasks', filters: {path: 'column', operator: 'EQ', value1: 'done'}}">
<dragDropConfig>
<dnd:DragInfo groupName="cards" sourceAggregation="items"/>
<dnd:DropInfo groupName="cards" drop=".onDrop"/>
</dragDropConfig>
<StandardListItem title="{title}"/>
</List>
</VBox>
</HBox>
onDrop: function (event) {
const item = event.getParameter("draggedControl");
const column = this.getView().getLocalId(event.getSource().getParent().getId());
const model = this.getView().getModel();
model.setProperty("column", column, item.getBindingContext());
model.refresh(true); // a client filter is not re-evaluated by setProperty alone
}
The list ID is the status, so one handler serves every column. event.getSource() is the DropInfo; its parent is the list that received the item.
Drag “Check delivery 80001234” to Done. Result: To do has one task, In progress one and Done two.
Why refresh is needed
setProperty updates the bound value, but a client-side list filter is not evaluated again by that call alone. Without refresh(true), the card stays in the old column. With OData, update the entity and let the bindings read again.
Limits of the list version
Drag and drop uses the browser’s native events. Offer another way to change the status for keyboard users, for example a menu on the item. The example also keeps no order inside a column; that needs a sequence field and dropPosition="OnOrBetween".
Board control with limits and keyboard
Kor, our open-source UI5 library, has a Board:
<Board label="Tasks" cardMove=".onCardMove" cards="{path: '/tasks', key: 'id'}">
<columns>
<BoardColumn key="todo" title="To do"/>
<BoardColumn key="doing" title="In progress" limit="2" state="info"/>
<BoardColumn key="done" title="Done" state="success"/>
</columns>
<cards>
<BoardCard key="{id}" column="{column}" title="{title}" person="{person}"/>
</cards>
</Board>
One binding holds all cards and column is updated in the model on drop. limit shows the work limit of a column. Ctrl or Cmd with an arrow key moves the focused card.
Which one to use
Use the lists if you need the Fiori look or cannot add a library. Use the board control if you need card movement, limits and keyboard support without writing them. Kor’s drag and drop does not support touch yet.
We ran both examples in Chrome with OpenUI5 1.108.55 and 1.154.0.
Sources: sap.ui.core.dnd.DragInfo API · sap.ui.core.dnd.DropInfo API