gregnb / mui-datatables

Datatables for React using Material-UI
MIT License
2.71k stars 934 forks source link

Request #2011

Open smaazs71 opened 1 year ago

smaazs71 commented 1 year ago

how can we prevent from onRowClick in a customBodyRender column Suppose we have a button or a select or an input box in the column. Then if we try to access this column it would also call the onRowClick function

Solution: Can provide event argument in onRowClick() callback

i.e. onRowClick: function(event: any, rowData: string[], rowMeta: { dataIndex: number, rowIndex: number }) => void

 then in callback user can use it to prevent further propagation.

Solution 2: Can provide the column index argument in onRowClick() callback

i.e. onRowClick: function(rowData: string[], rowMeta: { columnIndex: number, dataIndex: number, rowIndex: number }) => void

 then in callback user can use it to prevent further propagation.