I saw this response on how to hide a column. I need a little more complicated behavior. I have a react
table like this
var StockTable = React.createClass({
render: function () {
var items = [];
for (var symbol in this.props.stocks) {
var stock = this.props.stocks[symbol];
items.push(<OptionRow key={stock.symbol} stock={stock} bid={this.props.bid} ask = {this.props.ask} />);
}
return (
<table table-head id="stocktable">
...
I need to detect when a user clicks on the header of the table, get the column she clicked on, and hide that column. Then, if a user clicks a separate button on the page, I need all the columns that are hidden to display again.
It would also be nice if the cursor changed to something like a hand when in the table header to alert the user that an action is possible. Like it does when you hover over a button.