react-datatable
react-datatable copied to clipboard
Allow a column with custom controls to be defined
Maybe it would make sense to allow the user to define a custom column with room for custom controls like delete (simply X with confirmation) or edit (could open a modal).
The extra column would look something like this in configuration:
...
{ controls: [deleteControl, editControl]}
...
function deleteControl(row) {
// create delete button + logic here
// ie. it would ask for a confirmation and if confirmed, trigger table update
// (either direct, through flux etc.)
...
}
Note that it would be very handy if row parameter contained whole data objects instead of just the visible columns. Some data may be hidden on purpose esp. if there is a lot of it.