ForgeComponents
en

Components

j-ClBind

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

The component reads an item with a linked data source. The component supports Tangular template inside the element (optional). As the value is stored in the {{ value.something }} variable.


Configuration:

  • datasource {String} or dirsource {String} required a data-source
  • id {String} a pair key (default: id)
  • nullable {Boolean} renders null value (default: true)
  • exec {String} executes function(value, element) method
  • bind {String} binds a read value according to the defined path

Use it with <ui-component name="clbind">. 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
<ui-component name="clbind" path="form.typeid" config="datasource:#types;nullable:0;bind:form.type">
	<script type="text/html">
		<div>Value: {{ value.name }}</div>
	</script>
</ui-component>
<br />
<ui-bind path="!form.type" config="html:value.name"></ui-bind>

<script>
	DEF.cl.types = [{ id: 'totaljs', name: 'Total.js' }, { id: 'java', name: 'Java' }, { id: 'php', name: 'PHP' }, { id: '.net', name: '.NET' }];
	var form = {};
	form.typeid = 'totaljs';
</script>