Created
October 29, 2010 14:19
-
-
Save chrisgeo/653635 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<form id="myform" name="myform"> | |
<input type="radio" name="rad" value="foo" /> | |
<input type="radio" name="rad" value="bar" checked /> | |
</form> | |
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.2.0/build/yui/yui-min.js"></script> | |
<script type="text/javascript"> | |
YUI({ | |
filter: 'debug', | |
charset: 'utf-8', | |
combine: false | |
}).use('selector-css', 'node', 'event-custom', 'event', 'node-event-simulate', function(Y){ | |
var radios = Y.all('form[name=myform] input[name=rad]'); | |
Y.publish('trigger:radio', { | |
braodcast: 1, | |
emitFacade: true | |
}); | |
radios.on('trigger:radio', function(e){ | |
console.log(e); | |
console.log('fired'); | |
}); | |
console.log(radios.item(1)); | |
//doesn't fire | |
radios.item(1).fire('trigger:radio'); | |
//does | |
//radios.item(1)._node.click(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment