<html>
<head>
<title>ButtonGroup Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="/build/cssreset/reset-min.css" type="text/css" media="screen" title="no title" charset="utf-8">
YUI({
debug: true,
filter:"raw"
}).use('button-group', function(Y) {
var PushGroup = new Y.ButtonGroup({
srcNode : '#pushGroup',
type : 'push'
}).render();
var CheckboxGroup = new Y.ButtonGroup({
srcNode : '#checkboxGroup',
type : 'checkbox'
}).render();
var RadioGroup = new Y.ButtonGroup({
srcNode : '#radioGroup',
type : 'radio'
}).render();
PushGroup.on('press', function(e){
});
CheckboxGroup.on('selectionChange', function(e){
console.log(e.originEvent.target.get('id'));
console.log('CheckboxGroup - selectionChange');
});
RadioGroup.on('selectionChange', function(e){
console.log(this.getSelectedButtons()[0].get('label'));
console.log('Radio - selectionChange');
});
});
</script>
</head>
<body class='yui3-skin-sam'>
<div id="pushGroup">
<p>Push</p>
<button>A</button>
<button>B</button>
<button>C</button>
</div>
<hr>
<div id="checkboxGroup">
<p>Checkbox</p>
<button id='asd'>A</button>
<button>B</button>
<button>C</button>
</div>
<hr>
<div id="radioGroup">
<p>Radio</p>
<button>A</button>
<button>B</button>
<button>C</button>
</div>
</body>
</html>