ForgeComponents
en

Components

j-Planner

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

Data-source needs to contain:

{
    items: [{ id: '12345', name: 'A name of plan', dtbeg: NOW.add('-5 days'), dtend: NOW.add('3 days'), progress: 30, color: '#5385EA', title: 'A tooltip' }, ...] // items
    year: 2019
}

Configuration:

  • days {String} pluralization for days (optional, default: # days,# day,# days,# days)
  • exec {String} a path to variable or method function(item, el), it's evaluated if the user will click on the item
  • scroll {String} a path to variable or method function(y), it's evaluated if the user will scroll planner
  • parent {String} optional, a container with fixed width/height, can be window. Default value: parent element.)

Use it with <ui-component name="planner">. 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>
	body{padding:0;margin:0;background-color:#F0F0F0;font-family:Arial;height:100%;}
	html{height:100%;}
</style>

<ui-component name="planner" path="obj" config="exec:selected">
</ui-component>

<script>

	var obj = {};
	obj.year = NOW.getFullYear();
	obj.items = [];
	obj.items.push({ id: '1', name: 'jComponent', dtbeg: NOW.add('-5 days'), dtend: NOW.add('3 days'), progress: 30, color: '#769DEA' });
	obj.items.push({ id: '2', name: 'Total.js', dtbeg: NOW.add('-5 days'), dtend: NOW.add('3 days'), progress: 30, color: '#EACA76' });

	function selected(item, g) {
		console.log(item, g);
	}
</script>