ForgeComponents
en

Components

j-RadioButton

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • for custom design you can use j-RadioButtonExpert
  • now you can use datasource

Configuration:

  • items {String} needs to contain text 1|value 1;text 2|value 2 or text 1;text 2
  • required {Boolean} enables required
  • disabled {Boolean} disables this control
  • label {String} can change the content (default: innerHTML)
  • type {String} can contain number
  • inline {Boolean} enables/disables inline position (default: true)
  • datasource {String} path to data-source (must be array or array of objects)
  • text {String} determines a property name for text (in data-source), default: name
  • value {String} determines a property name for value (in data-source) default: id

Use it with <ui-component name="radiobutton">. 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="radiobutton" path="model.myvalue1" config="items:Yes|0,No|1,Maybe|2;type:number;required:true;inline:0" default="0">Are you crazy?</ui-component>
<br />
<ui-component name="radiobutton" path="model.myvalue2" config="datasource:frameworks;required:true">What is the best node.js framework?</ui-component>
<br />
<ui-component name="radiobutton" path="model.myvalue3" config="datasource:list;required:true">Total.js is framework for...</ui-component>

<script type="text/javascript">
	var frameworks = ['Total.js', 'express', 'Hapi', 'Koa', 'Sails'];
	var list = [{ name: 'Ruby', id: 1 }, { name: 'PHP', id: 2 }, { name: 'node.js', id: 3 }, { name: 'Python', id: 4 }];
</script>