Created
March 21, 2012 19:35
-
-
Save lsmith/2151800 to your computer and use it in GitHub Desktop.
Workaround for datatable.getColumn(node) (#2531924)
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
// Add support for table.getColumn( node ) | |
Y.DataTable.prototype.getColumn = (function (original) { | |
return function (seed) { | |
var cell; | |
if (Y.instanceof(seed, Y.Node)) { | |
cell = this.getCell(seed); | |
seed = cell && (cell.get('className').match( | |
new RegExp(this.getClassName('col', '(\\w+)'))) || [])[1]; | |
} | |
return original.call(this, seed); | |
}; | |
})(Y.DataTable.prototype.getColumn); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment