buttons.html revision 6240ba64235b1bebf5304d71a5acf0778f736501
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>WidgetButtons Manual Test</title>
</head>
<body>
<script>
YUI({filter: 'raw'}).use('base-build', 'widget', 'widget-buttons', function (Y) {
var testWidget = new Y.TestWidget({
headerContent: 'Test Widget',
buttons : [
{
label : 'Destroy',
isDefault: true,
action : function () {
this.destroy();
}
},
{label: 'Foo'},
{
name : 'close',
section : 'footer',
classNames: ['foo']
}
],
visible: false
});
testWidget.render('body');
testWidget.getButton('close').set('disabled', true);
testWidget.getButton(1, 'footer').setStyle('color', 'purple');
testWidget.set('visible', true);
testWidget.addButton({label: 'Eric'});
testWidget.set('buttons', testWidget.get('buttons'));
console.log(testWidget.get('buttons'));
});
</script>
</body>
</html>