JS3
JS3

Reputation: 1829

How can I use the delete button of muidatatable?

Whenever I'll click a row, it'll show a delete button. How can I access that button and put my own delete codes there?

Upvotes: 2

Views: 2421

Answers (1)

Babak Yaghoobi
Babak Yaghoobi

Reputation: 1985

use like this :

const options = {
    onRowsDelete:(e)=>{console.log(e.data)}, <---- e.data is a array of rows
    selectableRows:'single',
}

render(){
return(
<MUIDataTable
        title={"title"}
        data={data}
        columns={columns}
        options={options}
      />
)
}

Upvotes: 1

Related Questions