jKanban
Javascript plugin for Kanban boards
jKanban allow you to create and manage Kanban Board in your project!
Please try out the live demo!
GET SUPPORT / REQUIRE CUSTOM FEATURE
Install
Clone the repo and use the javascript and the css files in the dist
folder.
You have to include
<link rel="stylesheet" href="path/to/jkanban.min.css">
and
<script src="path/to/jkanban.min.js"></script>
in your page and you are done.
Usage
Init jKanban is a piece of cake!
var kanban = new jKanban(options)
Here's an overview of the default values.
var kanban = new jKanban({
element : '',
gutter : '15px',
widthBoard : '250px',
responsivePercentage: false,
dragItems : true,
boards : [],
dragBoards : true,
itemAddOptions: {
enabled: false,
content: '+',
class: 'kanban-title-button btn btn-default btn-xs',
footer: false
},
itemHandleOptions: {
enabled : false,
handleClass : "item_handle",
customCssHandler : "drag_handler",
customCssIconHandler: "drag_handler_icon",
customHandler : "<span class='item_handle'>+</span> %s"
},
click : function (el) {},
dragEl : function (el, source) {},
dragendEl : function (el) {},
dropEl : function (el, target, source, sibling) {},
dragBoard : function (el, source) {},
dragendBoard : function (el) {},
buttonClick : function(el, boardId) {}
})
Now take a look to the boards
object
[
{
"id" : "board-id-1",
"title" : "Board Title",
"class" : "class1,class2,...",
"dragTo": ['another-board-id',...],
"item" : [
{
"id" : "item-id-1",
"title" : "Item 1"
"class" : ["myClass",...]
},
{
"id" : "item-id-2",
"title" : "Item 2"
}
]
},
{
"id" : "board-id-2",
"title" : "Board Title 2"
}
]
WARNING: all ids are unique!
About custom properties
jKanban also support custom properties on items to improve your applications with html data- properties. You can define them at like:
[
{
"id" : "board-id-1",
"title" : "Board Title",
"item" : [
{
"id" : "item-id-1",
"title" : "Item 1",
"username": "username1"
},
{
"id" : "item-id-2",
"title" : "Item 2",
"username": "username2"
}
]
}
]
Which jKanban will convert to:
<main class="kanban-drag">
<div class="kanban-item" data-eid="item-id-1" data-username="username1">Item 1</div>
<div class="kanban-item" data-eid="item-id-2" data-username="username2">Item 2</div>
</main>
API
jKanban provides the easiest possible API to make your boards awesome!
Method Name | Arguments | Description |
---|
addElement | boardID, element | Add element in the board with ID boardID , element is the standard format |
addForm | boardID, formItem | Add formItem as html element into the board with ID boardID |
addBoards | boards | Add one or more boards in the kanban, boards are in the standard format |
findElement | id | Find board's item by id |
replaceElement | id, element | Replace item by id with element JSON standard format |
getParentBoardID | id | Get board ID of item id passed |
findBoard | id | Find board by id |
getBoardElements | id | Get all item of a board |
removeElement | id | Remove a board's element by id |
removeBoard | id | Remove a board by id |
Example
Clone the repo and look in the example
folder
Thanks
jKanban use dragula for drag&drop
Develop
Clone the repo then use npm install
for download all the dependencies then launch npm run build
for build the project
Pull Requests?
I'd love them!
Let's hear them! (The nice ones please!)
Me?
In case you're interested I'm @riktarweb