ForgeComponents
en

Components

j-Click

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

The component calls a method or can set a value according to the path.

Configuration:

  • enter {String} (optional) is a jQuery selector
  • value {String/Number/Boolean} (optional) this value will be set to data-jc-path
  • disabled {Boolean} disables this control

Use it with <ui-component name="click">. 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
<div id="form">
    <div><input type="text" placeholder="press enter" /></div>
</div>
<div><button><ui-component name="click" path="doSubmit" config="enter:#form">SUBMIT</ui-component></button></div>
<br />
<div><button><ui-component name="click" path="user.name" config="value:Peter">SET VALUE user.name</ui-component></button></div>
<ui-bind path="user.name" config="text"></ui-bind>

<script>
	function doSubmit() {
        alert('SUBMIT');
    }
</script>