Vue UI Components Documentation
The Vue Kanban can be used to implement the kanban method for a project. This guide adds the Vue Kanban (jqxKanban) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxkanban.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxKanban from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxkanban.vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
With <script setup>, an imported component is ready to use in the template. jqx.base.css is required; the second file is a theme, selected with the theme attribute.
The Default Functionality demo as a Single-File Component:
<template>
<JqxSplitter :width="700" :height="600" :panels="mainSplitterPanels">
<div id="kanban1">
<JqxKanban
ref="myKanbanOne"
:width="'100%'"
:height="'100%'"
:source="dataAdapter"
:columns="kanbanOneColumns"
:connectWith="'#kanban2, #kanban3'"
:resources="resourcesAdapterFunc()"
>
</JqxKanban>
</div>
<div>
<JqxSplitter
:width="'100%'"
:height="'100%'"
:orientation="'horizontal'"
:panels="rightSplitterPanels"
>
<div id="kanban2">
<JqxKanban
ref="myKanbanTwo"
:width="'100%'"
:height="'100%'"
:source="dataAdapter2"
:columns="kanbanTwoColumns"
:connectWith="'#kanban1, #kanban3'"
:resources="resourcesAdapterFunc()"
>
</JqxKanban>
</div>
<div id="kanban3">
<JqxKanban
ref="myKanbanThree"
:width="'100%'"
:height="'100%'"
:source="dataAdapter3"
:columns="kanbanThreeColumns"
:connectWith="'#kanban2, #kanban1'"
:resources="resourcesAdapterFunc()"
>
</JqxKanban>
</div>
</JqxSplitter>
</div>
</JqxSplitter>
</template>
<script setup>
import { ref } from 'vue';
import JqxKanban from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxkanban.vue';
import JqxSplitter from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsplitter.vue';
const myKanbanOne = ref(null);
const myKanbanTwo = ref(null);
const myKanbanThree = ref(null);
const fields = [
{ name: 'status', map: 'state', type: 'string' },
{ name: 'text', map: 'label', type: 'string' },
{ name: 'tags', type: 'string' },
{ name: 'color', map: 'hex', type: 'string' },
{ name: 'resourceId', type: 'number' }
];
const source = {
localData: [
{
state: 'new',
label: 'Combine Orders',
tags: 'orders, combine',
hex: '#5dc3f0',
resourceId: 3
},
{
state: 'new',
label: 'Change Billing Address',
tags: 'billing',
hex: '#f19b60',
resourceId: 1
},
{
state: 'new',
label: 'One item added to the cart',
tags: 'cart',
hex: '#5dc3f0',
resourceId: 3
},
{
state: 'new',
label: 'Edit Item Price',
tags: 'price, edit',
hex: '#5dc3f0',
resourceId: 4
},
{ state: 'new', label: 'Login 404 issue', tags: 'issue, login', hex: '#6bbd49' }
],
dataType: 'array',
dataFields: fields
};
const source2 = {
localData: [
{
state: 'ready',
label: 'Logout issue',
tags: 'logout, issue',
hex: '#5dc3f0',
resourceId: 7
},
{
state: 'ready',
label: 'Remember password issue',
tags: 'password, issue',
hex: '#6bbd49',
resourceId: 8
},
{
state: 'ready',
label: 'Cart calculation issue',
tags: 'cart, calculation',
hex: '#f19b60',
resourceId: 9
},
{ state: 'ready', label: 'Remove topic issue', tags: 'topic, issue', hex: '#6bbd49' }
],
dataType: 'array',
dataFields: fields
};
const source3 = {
localData: [
{
state: 'done',
label: 'Delete orders',
tags: 'orders, combine',
hex: '#f19b60',
resourceId: 4
},
{ state: 'work', label: 'Add New Address', tags: 'address', hex: '#6bbd49', resourceId: 5 },
{ state: 'new', label: 'Rename items', tags: 'rename', hex: '#5dc3f0', resourceId: 6 },
{ state: 'work', label: 'Update cart', tags: 'cart, update', hex: '#6bbd49' }
],
dataType: 'array',
dataFields: fields
};
const dataAdapter = ref(new jqx.dataAdapter(source));
const dataAdapter2 = ref(new jqx.dataAdapter(source2));
const dataAdapter3 = ref(new jqx.dataAdapter(source3));
const kanbanOneColumns = ref([{ text: 'Backlog', dataField: 'new', maxItems: 10 }]);
const kanbanTwoColumns = ref([{ text: 'Ready', dataField: 'ready', maxItems: 10 }]);
const kanbanThreeColumns = ref([
{ text: 'Backlog', dataField: 'new', maxItems: 5 },
{ text: 'In Progress', dataField: 'work', maxItems: 5 },
{ text: 'Done', dataField: 'done', maxItems: 5 }
]);
const mainSplitterPanels = ref([{ size: 250, min: 100 }, { min: 250 }]);
const rightSplitterPanels = ref([{ min: 200, size: 350, collapsible: false }, { min: 200 }]);
function resourcesAdapterFunc() {
let resourcesSource = {
localData: [
{
id: 0,
name: 'No name',
image: 'https://www.jqwidgets.com/vue/images/common.png',
common: true
},
{
id: 1,
name: 'Andrew Fuller',
image: 'https://www.jqwidgets.com/vue/images/andrew.png'
},
{
id: 2,
name: 'Janet Leverling',
image: 'https://www.jqwidgets.com/vue/images/janet.png'
},
{
id: 3,
name: 'Steven Buchanan',
image: 'https://www.jqwidgets.com/vue/images/steven.png'
},
{
id: 4,
name: 'Nancy Davolio',
image: 'https://www.jqwidgets.com/vue/images/nancy.png'
},
{
id: 5,
name: 'Michael Buchanan',
image: 'https://www.jqwidgets.com/vue/images/Michael.png'
},
{
id: 6,
name: 'Margaret Buchanan',
image: 'https://www.jqwidgets.com/vue/images/margaret.png'
},
{
id: 7,
name: 'Robert Buchanan',
image: 'https://www.jqwidgets.com/vue/images/robert.png'
},
{
id: 8,
name: 'Laura Buchanan',
image: 'https://www.jqwidgets.com/vue/images/Laura.png'
},
{
id: 9,
name: 'Laura Buchanan',
image: 'https://www.jqwidgets.com/vue/images/Anne.png'
}
],
dataType: 'array',
dataFields: [
{ name: 'id', type: 'number' },
{ name: 'name', type: 'string' },
{ name: 'image', type: 'string' },
{ name: 'common', type: 'boolean' }
]
};
let resourcesDataAdapter = new jqx.dataAdapter(resourcesSource);
return resourcesDataAdapter;
}
function kanbanOneColumnRenderer(element, collapsedElement, column) {
if (element[0]) {
let headerStatus = element[0].getElementsByClassName('jqx-kanban-column-header-status')[0];
let columnItems = myKanbanOne.value.getColumnItems(column.dataField).length;
headerStatus.innerHTML = ' (' + columnItems + '/' + column.maxItems + ')';
}
}
function kanbanTwoColumnRenderer(element, collapsedElement, column) {
if (element[0]) {
let headerStatus = element[0].getElementsByClassName('jqx-kanban-column-header-status')[0];
let columnItems = myKanbanTwo.value.getColumnItems(column.dataField).length;
headerStatus.innerHTML = ' (' + columnItems + '/' + column.maxItems + ')';
}
}
function kanbanThreeColumnRenderer(element, collapsedElement, column) {
if (element[0]) {
let columnItems = myKanbanThree.value.getColumnItems(column.dataField).length;
let headerStatus = element[0].getElementsByClassName('jqx-kanban-column-header-status')[0];
headerStatus.innerHTML = ' (' + columnItems + '/' + column.maxItems + ')';
let collapsedHeaderStatus = collapsedElement[0].getElementsByClassName(
'jqx-kanban-column-header-status'
)[0];
collapsedHeaderStatus.innerHTML = ' (' + columnItems + '/' + column.maxItems + ')';
}
}
</script>
<style></style>Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, columnAttrClicked: This event is triggered when jqxKanban column is clicked.
<script setup>
function onColumnAttrClicked(event) {
console.log(event.args);
}
</script>
<template>
<JqxKanban @columnAttrClicked="onColumnAttrClicked" />
</template>
Call methods through a template ref. For example, addItem: Add new item in widget.
<script setup>
import { ref, onMounted } from 'vue';
const myKanban = ref(null);
onMounted(() => {
myKanban.value.addItem({ status: "new", text: "New Task", tags: "new task", color: "#5dc3f0" });
});
</script>
<template>
<JqxKanban ref="myKanban" />
</template>
Every component also has setOptions({ … }) and getOptions('name').