# j-Kanban

> Important: each item needs own ID {String}, look to example.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: c2a9890ca0363889432d4b5c459599a3cf7e2aba2ca892cabaeb61e8b01b2b04
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

__Configuration__:

- `parent {String}` a container with fixed height, can be `window`. Default value: `parent` element.
- `margin {Number}` a top/bottom margin together (default: `0`)
- `padding {Number}` a padding between panels (default: `10`)
- `style {Number}` a style, `1` (default): boxes will have a full-height, `2` boxes will have `max-height `
- `move {String}` a path to method `function(group, target)`, is executed if the user moves an item to another group
- `remove {String}` a path to method `function(group)`, is executed if the user removes an item in group
- `dblclick {String}` a path to method `function(group)`, is executed if the user performs double click

__Methods__:

- `component.remove(id)` can remove an item in group
- `component.findgroup(id)` returns a group instance

__Important__: each item needs own ID {String}, look to example.

Use it with `<ui-component name="kanban">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<style>
	.caption { line-height: 50px; border-bottom: 1px solid #E0E0E0; padding: 0 10px; font-weight: bold; }
	.ui-dark .caption { border-bottom-color: #404040; }
</style>

<ui-component name="kanban" path="items" config="parent:window;move:onmoveitem;margin:50">

	<!-- Group header rendering -->
	<script type="text/html">
		<div class="caption">{{ name }}</div>
	</script>

	<!-- Item rendering -->
	<script type="text/html">
		<div>{{ name }}</div>
	</script>
</ui-component>

<script>

	var items = [];
	items.push({ id: '1', name: 'In progress', items: [{ id: '11', name: 'Better life Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea culpa voluptatem asperiores aspernatur doloremque cupiditate error, qui sit est quas.' }] });
	items.push({ id: '2', name: 'Pending', items: [{ id: '21', name: 'Improve j-ChunkyScroll' }] });
	items.push({ id: '3', name: 'Done', items: [{ id: '31', name: 'Fix scrollbars j-DataGrid' }, { id: '32', name: 'Improve performace' }] });

	function onmoveitem(group, target) {
		console.log('MOVEMENT:', group, target);
	}

</script>
```
