ForgeComponents
en

Components

j-Kanban

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

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.

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>