Skip to content

Instantly share code, notes, and snippets.

View hatched's full-sized avatar

Jeff Pihach hatched

View GitHub Profile
setValue : function(e) {
var value = [];
switch(e.currentTarget.get('type')){
case "select-one": //fall through intentional
case "select-multiple":
e.currentTarget.get('options').each(function(opt){
if(opt.get('selected') === true) {
value.push(opt.get('value'));
}
});
table._createTbodyTdNode = function(o) {
var column = o.column;
o.headers = column.headers;
o.classnames = column.get("classnames");
o.value = this.formatDataCell(o);
o.refId = o.data.id;
return Y.Node.create(Y.substitute('<td headers="{headers}" class="{classnames}" _id="{refId}"><div class="yui3-datatable-liner editable">{value}</div></td>', o));
}
/**
* Adds a method to the Y.Base prototype to handle events so that when a widget
* or plugin becomes destroyed all events attached are detached.
*
* Requires Y.Lang & Y.Array
*/
YUI.add('event-handler', function(Y) {
var YArray = Y.Array;
table._createTbodyTdNode = function(o) {
var column = o.column;
o.headers = column.headers;
o.classnames = column.get("classnames");
o.value = this.formatDataCell(o);
o.refId = o.data.id;
return Y.Node.create(Y.substitute('<td headers="{headers}" class="{classnames}" _id="{refId}"><div class="yui3-datatable-liner editable">{value}</div></td>', o));
}
YUI.add('event-handler', function(Y) {
var YArray = Y.Array;
function EventHandler() {}
//Y.Base.prototype.eventHandler = {
Y.mix(EventHandler.prototype, {
add : function(event) {
contentBoxContent: Y.Node.create('<div class="contentboxcontent"><div id="tabviewcontainer></div></div>'),
renderUI: function() {
this.get('contentBox').insert(this.contentBoxContent);
new Y.Tabview().render(this.get('contentBox').one('#tabviewcontainer'));
}
YUI().use('event-custom', function(Y) {
Y.Global.on('myevent:init', function() {
Y.log('event init');
});
});
YUI().use('event-custom', function(Y) {
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
YUI.add('widget', function(Y) {
}, '1.0.0', {requires: ['node', 'gallery-awesome'});
YUI({
modules: {
'rollup' : {
fullpath: 'rollup.js',
requires: ['node', 'io', 'json']
}
}
}).use('rollup', function(Y) {
//module1, module2, and module3 are available here