I have a table in my main page lets say main.js, All I want is that every click in a row of the table I want it to display the data in my drawer. Anybody knows how to achieve this?. I followed a few examples but I can't get it right.
and I like to display it into this drawer.
But my Drawer and my Table are separate files so
Here's my code:
class Main extends React.Component {
render(){
return (
<Table multiSelectable={this.state.multiSelectable}
onRowSelection={this._onRowSelection}>
<TableHeader>
<TableRow>
<TableHeaderColumn style={tablestyles.columns.id}>
ID
</TableHeaderColumn>
<TableHeaderColumn style={tablestyles.columns.name}>
Name
</TableHeaderColumn>
<TableHeaderColumn style={tablestyles.columns.price}>
Price
</TableHeaderColumn>
<TableHeaderColumn style={tablestyles.columns.category}>
Category
</TableHeaderColumn>
<TableHeaderColumn style={tablestyles.columns.edit}>
Edit
</TableHeaderColumn>
</TableRow>
</TableHeader>
<TableBody>
{Data.tablePage.items.map(item =>
<TableRow key={item.id}>
<TableRowColumn style={tablestyles.columns.id}>
{item.id}
</TableRowColumn>
<TableRowColumn style={tablestyles.columns.name}>
{item.name}
</TableRowColumn>
<TableRowColumn style={tablestyles.columns.price}>
{item.price}
</TableRowColumn>
<TableRowColumn style={tablestyles.columns.category}>
{item.category}
</TableRowColumn>
<TableRowColumn style={tablestyles.columns.edit}>
<Link className="button" to="/form">
<FloatingActionButton zDepth={0}
mini={true} backgroundColor={grey200}
iconStyle= {tablestyles.editButton}>
<ContentCreate />
</FloatingActionButton>
</Link>
</TableRowColumn>
</TableRow>
) }
</TableBody>
);
}
};
export default CargoAddTable;
and I want to display the data in every click of the row into the white space inside the drawer.
and heres my code:
<Paper style={papers} zDepth={5}>
{this.props.onRowSelection}
</Paper>
this gives me no error and no output.