Closed ahmetsezen closed 5 years ago
i couldn't use onRowClick and expandable rows. code example :
class RaporTable extends React.Component { state = { columns: [ { name: 'İşlem Tarihi', options: { filter: true } }, { name: 'Adı Soyadı', options: { filter: true, } }, { name: 'Road', options: { filter: true, } }, { name: 'Miktar', options: { filter: true, } }, ], data: [ ['22/11/2018', 'Business Analyst', 100, 123], ['23/12/2018', 'Business Consultant', 2000, 333], ['24/11/2018', 'Attorney', 5000, 445], ['25/11/2018', 'Business Analyst', 500, 675], ['26/11/2018', 'Business Consultant', 7500, 789], ['27/11/2018', 'Business Management Analyst', 9400, 562], ['28/11/2018', 'Agency Legal Counsel', 210, 953], ['29/11/2018', 'Commercial Specialist', 650, 369], ] } render() { const { columns, data } = this.state; const { classes } = this.props; const options = { filterType: "dropdown", responsive: "stacked", filter: false, download: false, print: false, selectableRows: true, search: false, onRowClick: (row,index)=>{ alert(row) } }; return ( <div className={classes.table}> <MUIDataTable title="Rapor" data={data} columns={columns} options={options} /> </div> ); } } RaporTable.propTypes = { classes: PropTypes.object.isRequired }; export default withStyles(styles)(RaporTable);
https://codesandbox.io/s/my73nr7q69?fontsize=14
https://stackoverflow.com/questions/31079081/programmatically-navigate-using-react-router
https://github.com/gregnb/mui-datatables/issues/456
:D
Closing, as this is a duplicate of https://github.com/gregnb/mui-datatables/issues/553. Also, I believe this functionality is now working, but if not, you can continue in the other issue thread.
i couldn't use onRowClick and expandable rows. code example :