Skip to content

Instantly share code, notes, and snippets.

@apipkin
Created August 20, 2013 23:35
Show Gist options
  • Save apipkin/6288718 to your computer and use it in GitHub Desktop.
Save apipkin/6288718 to your computer and use it in GitHub Desktop.
function HideShow () {};
HideShow.ATTRS = {
styleSheet: {
valueFn: '_styleSheetValFn'
}
};
Y.mix(HideShow.prototype, {
_stylePrefix: null,
initializer: function () {
var sheet = this.get('styleSheet');
this._stylePrefix = this.get('boundingBox').get('id');
Y.later(4000, this, function() {
this.hideColumn('name');
});
},
setColumnWidth: function (col, width) {
}
hideColumn: function (col) {
var colSelector = '#' + this._stylePrefix + ' .' + this._cssPrefix + '-col-' + col;
this.get('styleSheet').set(colSelector, {
width: '1px',
overflow: 'hidden',
display: 'none'
});
},
showColumn: function (col) {
},
_styleSheetValFn: function () {
return Y.StyleSheet(this.get('boundingBox').get('id'));
}
});
Y.DataTable.HideShow = HideShow;
Y.Base.mix(Y.DataTable, [HideShow]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment