j-RadioButton
- for custom design you can use j-RadioButtonExpert
- now you can use datasource
Configuration:
items{String} needs to containtext 1|value 1;text 2|value 2ortext 1;text 2required{Boolean} enablesrequireddisabled{Boolean} disables this controllabel{String} can change the content (default:innerHTML)type{String} can containnumberinline{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:namevalue{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.
<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>