Skip to content

Instantly share code, notes, and snippets.

@tivac
Created December 2, 2011 18:44
Show Gist options
  • Save tivac/1424351 to your computer and use it in GitHub Desktop.
Save tivac/1424351 to your computer and use it in GitHub Desktop.
Patching YUI module bugs
var config = {
groups : {
patches : {
base : "/js/patches/",
modules : {
"datatable-patches" : {
path : "datatable.js",
condition : {
name : "datatable-patches",
trigger : "datatable-base",
test : function() { return true; }
}
}
}
}
}
};
YUI.add("datatable-patches", function(Y) {
var L = Y.Lang;
//monkey patch DT to fix bug: http://yuilibrary.com/projects/yui3/ticket/2529920
Y.DataTable.Base.prototype._createTbodyTdNode = function (o) {
var col = o.column;
o.headers = col.headers;
o.classnames = col.get("classnames");
o.td = Y.Node.create(L.substitute(this.tdTemplate, o));
o.td.one('div').setContent(this.formatDataCell(o));
return o.td;
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment