Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created March 21, 2012 19:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsmith/2151800 to your computer and use it in GitHub Desktop.
Save lsmith/2151800 to your computer and use it in GitHub Desktop.
Workaround for datatable.getColumn(node) (#2531924)
// 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