Created
December 2, 2011 18:44
-
-
Save tivac/1424351 to your computer and use it in GitHub Desktop.
Patching YUI module bugs
This file contains hidden or 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
var config = { | |
groups : { | |
patches : { | |
base : "/js/patches/", | |
modules : { | |
"datatable-patches" : { | |
path : "datatable.js", | |
condition : { | |
name : "datatable-patches", | |
trigger : "datatable-base", | |
test : function() { return true; } | |
} | |
} | |
} | |
} | |
} | |
}; |
This file contains hidden or 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
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